A week ago, every project I had was working normally, but when I updated my Eclipse to the Oxygen version and installed JDK-9, things have come strange.
When I try to use Strings, after some time (more like every time I save the project) the compiler throws me an error for every String in my project.
String type being recognized as an ambiguous class
"The type java.lang.String is ambiguous"
So I've tried importing java.lang.String
to see if it fix the error:
After the import
"The package java.lang is accessible from more than one module: java.base, java.base"
Surprise! ??
It doesn't :(
I've tried searching these messages on Google and SO but I found nothing...
However, the code running in JDK 8 seems to run normally, check it out:
Changing to JDK 8 (1.8.0_72)
(Code is not showing any errors before the Apply because I've applied, and open up the compiler preferences again for the screenshot)
The console error:
Error: Main method not found in class me.mateusakino.ypul.yPuLTester
, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
EDIT 1 - Main class
EDIT 5 - Stacktrace of the errors on Edit 4 (workspace/.metadata/.log)
!SESSION 2017-10-13 13:11:39.551 -----------------------------------------------
eclipse.buildId=4.7.1.M20171009-0410
java.version=9
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
This is a continuation of log file C:UsersHomeDesktopDeveloper FoldersJavaOxygen Workspace.metadata.bak_0.log
Created Time: 2017-10-13 13:43:14.245
!ENTRY org.eclipse.core.resources 4 75 2017-10-13 13:43:14.245
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.jdt.core 4 75 2017-10-13 13:43:14.245
!MESSAGE Errors running builder 'Java Builder' on project 'yPuL'.
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.lookup.ModuleBinding$UnNamedModule.canAccess(ModuleBinding.java:71)
at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:230)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getPackage(Scope.java:2922)
at org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:108)
at org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference.getTypeBinding(ArrayQualifiedTypeReference.java:93)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:495)
at org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference.internalResolveType(ArrayQualifiedTypeReference.java:107)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:586)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:582)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesWithSuspendedTempErrorHandlingPolicy(SourceTypeBinding.java:1932)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1835)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:1525)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.internalFaultInTypeForFieldsAndMethods(SourceTypeBinding.java:907)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.faultInTypesForFieldsAndMethods(SourceTypeBinding.java:902)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:514)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:882)
at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:141)
at java.base/java.lang.Thread.run(Thread.java:844)
!ENTRY org.eclipse.core.resources 4 2 2017-10-13 13:43:24.691
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
!ENTRY org.eclipse.core.resources 4 75 2017-10-13 13:43:24.695
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.jdt.core 4 75 2017-10-13 13:43:24.695
!MESSAGE Errors running builder 'Java Builder' on project 'yPuL'.
!STACK 0
java.lang.NullPointerException
!ENTRY org.eclipse.core.resources 4 2 2017-10-13 13:43:39.104
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
!ENTRY org.eclipse.core.resources 4 75 2017-10-13 13:43:39.110
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.jdt.core 4 75 2017-10-13 13:43:39.110
!MESSAGE Errors running builder 'Java Builder' on project 'yPuL'.
!STACK 0
java.lang.NullPointerException
!ENTRY org.eclipse.core.resources 4 2 2017-10-13 13:44:37.810
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.lookup.ModuleBinding$UnNamedModule.canAccess(ModuleBinding.java:71)
at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:230)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getPackage(Scope.java:2922)
at org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:108)
at org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference.getTypeBinding(ArrayQualifiedTypeReference.java:93)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:495)
at org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference.internalResolveType(ArrayQualifiedTypeReference.java:107)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:586)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:582)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesWithSuspendedTempErrorHandlingPolicy(SourceTypeBinding.java:1932)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1835)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:1525)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.internalFaultInTypeForFieldsAndMethods(SourceTypeBinding.java:907)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.faultInTypesForFieldsAndMethods(SourceTypeBinding.java:902)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:514)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:882)
at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:141)
at java.base/java.lang.Thread.run(Thread.java:844)
!ENTRY org.eclipse.core.resources 4 75 2017-10-13 13:44:37.814
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.jdt.core 4 75 2017-10-13 13:44:37.814
!MESSAGE Errors running builder 'Java Builder' on project 'yPuL'.
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.lookup.ModuleBinding$UnNamedModule.canAccess(ModuleBinding.java:71)
at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:230)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getPackage(Scope.java:2922)
at org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:108)
at org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference.getTypeBinding(ArrayQualifiedTypeReference.java:93)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:495)
at org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference.internalResolveType(ArrayQualifiedTypeReference.java:107)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:586)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:582)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesWithSuspendedTempErrorHandlingPolicy(SourceTypeBinding.java:1932)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1835)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:1525)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.internalFaultInTypeForFieldsAndMethods(SourceTypeBinding.java:907)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.faultInTypesForFieldsAndMethods(SourceTypeBinding.java:902)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:514)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:882)
at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:141)
at java.base/java.lang.Thread.run(Thread.java:844)
!ENTRY org.eclipse.core.resources 4 2 2017-10-13 13:44:53.701
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.lookup.ModuleBinding$UnNamedModule.canAccess(ModuleBinding.java:71)
at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:230)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getPackage(Scope.java:2922)
at org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:108)
at org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference.getTypeBinding(ArrayQualifiedTypeReference.java:93)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:495)
at org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference.internalResolveType(ArrayQualifiedTypeReference.java:107)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:586)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:582)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesWithSuspendedTempErrorHandlingPolicy(SourceTypeBinding.java:1932)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1835)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:1525)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.internalFaultInTypeForFieldsAndMethods(SourceTypeBinding.java:907)
at org.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…