JDK-9 won't let me use Strings: "java.lang.String is ambiguous"?

JDK-9 won't let me use Strings: "java.lang.String is ambiguous"?

jdk 9 download
java 9 32 bit download
java jdk 12
jdk 13
java download for windows 10
jdk 1.8.0_181 download
java 10
jdk 9 download 64 bit

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:\Users\Home\Desktop\Developer Folders\Java\Oxygen 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.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:53.706
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.jdt.core 4 75 2017-10-13 13:44:53.706
!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)
!SESSION 2017-10-13 13:46:42.392 -----------------------------------------------
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

!ENTRY org.eclipse.jface 2 0 2017-10-13 13:46:49.852
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2017-10-13 13:46:49.852
!MESSAGE A conflict occurred for CTRL+TAB:
Binding(CTRL+TAB,
    ParameterizedCommand(Command(org.eclipse.ui.window.nextEditor,Next Editor,
        Switch to the next editor,
        Category(org.eclipse.ui.category.window,Window,null,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5e8359da,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+TAB,
    ParameterizedCommand(Command(org.eclipse.ui.window.nextEditor,Next Editor,
        Switch to the next editor,
        Category(org.eclipse.ui.category.window,Window,null,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5e8359da,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2017-10-13 13:46:49.852
!MESSAGE A conflict occurred for CTRL+SHIFT+TAB:
Binding(CTRL+SHIFT+TAB,
    ParameterizedCommand(Command(org.eclipse.ui.window.previousEditor,Previous Editor,
        Switch to the previous editor,
        Category(org.eclipse.ui.category.window,Window,null,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@36b6802f,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+TAB,
    ParameterizedCommand(Command(org.eclipse.ui.window.previousEditor,Previous Editor,
        Switch to the previous editor,
        Category(org.eclipse.ui.category.window,Window,null,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@36b6802f,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)

!ENTRY com.vaadin.designer2 1 0 2017-10-13 13:47:00.882
!MESSAGE Schedule fetching all notifications

!ENTRY com.vaadin.designer2 1 0 2017-10-13 13:47:02.845
!MESSAGE Parse notifications

!ENTRY com.vaadin.designer2 1 0 2017-10-13 13:47:03.278
!MESSAGE Requesting user info (notification settings URL)

!ENTRY com.vaadin.designer2 1 0 2017-10-13 13:47:04.704
!MESSAGE HTTP Response code :200

!ENTRY org.eclipse.egit.ui 2 0 2017-10-13 13:47:06.014
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Home'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.dltk.core 4 0 2017-10-13 13:47:07.129
!MESSAGE Unable to find any indexer

!ENTRY org.apache.ivyde.eclipse 1 0 2017-10-13 13:48:10.554
!MESSAGE starting IvyDE plugin

!ENTRY org.apache.ivyde.eclipse 1 0 2017-10-13 13:48:10.571
!MESSAGE IvyDE plugin started

!ENTRY org.eclipse.ui 2 2 2017-10-13 13:48:12.395
!MESSAGE Invalid property category path: org.eclipse.cdt.managedbuilder.ui.properties.Page_head_build (bundle: org.eclipse.cdt.ui, propertyPage: org.eclipse.cdt.managedbuilder.ui.properties.BuildLogPreferencePage)

!ENTRY org.eclipse.jface 4 2 2017-10-13 13:48:45.611
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.IllegalArgumentException
    at org.eclipse.core.resources.ProjectScope.<init>(ProjectScope.java:58)
    at com.vaadin.designer2.eclipse.preferences.VisualDesignerPreferences.getProjectPreferences(VisualDesignerPreferences.java:680)
    at com.vaadin.designer2.eclipse.preferences.VisualDesignerPreferences.getDefaultDesigner(VisualDesignerPreferences.java:245)
    at com.vaadin.designer2.eclipse.preferences.DesignerProjectPreferencePage.createDesignerSelection(DesignerProjectPreferencePage.java:179)
    at com.vaadin.designer2.eclipse.preferences.DesignerProjectPreferencePage.createContents(DesignerProjectPreferencePage.java:109)
    at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:241)
    at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1426)
    at org.eclipse.jface.preference.PreferenceDialog$8.run(PreferenceDialog.java:1193)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:44)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
    at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1185)
    at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:591)
    at org.eclipse.jface.preference.PreferenceDialog$5.lambda$0(PreferenceDialog.java:657)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.preference.PreferenceDialog$5.selectionChanged(PreferenceDialog.java:654)
    at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:872)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:44)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
    at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:869)
    at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1238)
    at org.eclipse.jface.viewers.StructuredViewer.lambda$0(StructuredViewer.java:1261)
    at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:81)
    at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:261)
    at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:256)
    at org.eclipse.jface.util.OpenStrategy$1.lambda$1(OpenStrategy.java:426)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4213)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3820)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
    at org.eclipse.jface.window.Window.open(Window.java:794)
    at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
    at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
EDIT 7:

I could reproduce it in another workspace (Temp Workspace), and here is the .classpath file asked from @howlger:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="output" path="bin"/>
</classpath>
EDIT 8 - Eclipse report (Asked by Howlger):

https://bugs.eclipse.org/bugs/show_bug.cgi?id=526020

Details:
  • OS: Windows 10 Home (64bit)
  • JDK 9.0
  • Initial Eclipse: Oxygen Release (4.7.0) Build id: 20170620-1800
  • Current Eclipse: Oxygen.1a Release (4.7.1a) Build id: 20171005-1200
  • EDIT 4: Project settings:
    • Referenced Libraries: jRegex
    • Encoding: UTF-8
    • Compiler Settings
    • Execution Envieroments
  • EDIT 4: Java 9 Version: build 9+181
  • EDIT 4: Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
  • EDIT 6: All Eclipse's Plugins
  • If any other information is needed, please ask in the comment section...
What I've tried:
  • Restarting the IDE
  • Searching if there is more than one String in the Java Proposals/Completion (There was only one, java.lang's).
  • Checked the JRE System Library for more than one java.base package (There was only one, from jrt-fs.jar).
  • EDIT 2: adding modules through eclipse.ini
  • EDIT 2: updating eclipse to the version: 4.7.1a (Too many images in this post already)
  • EDIT 3: checked for double JDKs in the project and/or Eclipse preferences (Image link)
  • EDIT 4: Rebuilding java index (didn't work), enabling New Java index and rebuilding again: worked for around 3 minutes, but then this error appeared and the glitches came back again: java.lang.ClassCastException while building
  • EDIT 4: Removing JDK 9 from default library and adding it back again, the same thing from above, but this time it has thrown the error: java.lang.NullPointerException to the workspace, and the String error is still happening, even after restarting the IDE... (BTW, this warning appeared to the package keyword, not sure if it was already here before...)

Java SE, Release Notes for JDK 9 and JDK 9 Update Releases. Release Notes for JNLP files won't launch from IE11 on Windows 10 Creators Update.


For Java 9 support you need either:

  1. Eclipse Oxygen.1a, available from https://www.eclipse.org/downloads/eclipse-packages/

    or

  2. Manually configure your pre-Oxygen.1a Eclipse with Java 9 support, according to https://wiki.eclipse.org/Configure_Eclipse_for_Java_9

Option 1 is clearly the simpler one, as long as you have control over what version of Eclipse you install and use.

Complete JDK 9 Release Notes, JDK 9 has been superseded. Please visit jdk.java.net for the current version. Older releases, which do not include the most up to date security vulnerability fixes 


For me the problem was solved by deleting the project from Eclipse (and deleting from disk). Then git-clone and create project and the problem was solved.

JDK 9 Releases, 12 released in 2019, the Java platform has been actively being developed for about nearly 24 years.


I had same problem in Eclipse Oxygen to import the String package explicitly. The problem got solved after updating the eclipse and removing the user library used in the project.

Java SE versions history, has officially listed the general availability target date as July 27, 2017.


Idk if this helps but I ran into a similar problem: Basic classes were not recognized.

My confusion arose from the new Java convention of bundling rt.jar (and others) into an extension-less "modules" file---changing a decade-old, class-reference strategy.

Getting Eclipse to compile with JDK-10 (or JDK-9) therefore required a few things:

  1. Window->Preferences->Java->Installed JREs->Add...->Standard VM-->(Navigate to JDK-10)
  2. Window->Preferences->Java->Compiler->JDK Compliance:Compiler compliance level: 10
  3. Right-click Project->Build Path->Configure Build Path->Java Build Path->Libraries->Highlight Modulepath->Add Library->JRE System Library->Next->Select JRE 9/10 Per config->Finish

Note: #3 above is not possible unless you have performed #2 because Eclipse will not introduce the "Modulepath" option (in #3) until you have raised your Compiler compliance level (in #2).

Admittedly, this was probably obvious to most...alas, I was not most.

Java 9: new features, release date and more, , stick with 11. If you are in an “approved software” environment, stick with 11.


Which JDK version should I use? JDK 12 or 11?, Java SE 9 boasts modularity, REPL, compiler improvements, and Java's faster release cadence means developers won't have to wait as long 


Does JDK includes JRE?, Java 7 is no longer publicly supported, and Java 9 has stopped receiving updates since Java 9 was a short-term rapid release version that has been superseded 


What's new in Java 9 and JDK 9: Everything you need to know , JDK 9 and the Java Plugin. By late 2015, many browser vendors have either removed or announced timelines for the removal of standards based plugin support