I am trying to learn new concept of modules in JAVA. I am using Eclipse oxygen 4.7.3a with JDK 11.0.1.
I am getting syntax error warning on my module-info.java file. It seems that compiler is not able to parse new keywords of module-info.java file.
I performed following solution to fix this issue :
Installed all JAVA 11 updates from Eclipse JAVA 11 updates URL : http://download.eclipse.org/eclipse/updates/4.9-P-builds
Added JVM argument "--add-modules=java.se.ee" to eclipse.ini file.
But issue is still there . Any suggestions/inputs appreciated !
Java 11 requires
or Eclipse 2018-12 (4.10) which will be released on December 19, 2018.
Eclipse Oxygen was released before Eclipse Photon, Eclipse 2018-09 and Java 11 and therefore cannot detect a Java 11 JDK/JRE yet.
In addition, the Java compiler compliance level must set to 9 or higher (Project > Properties: Java Compiler) to have a module-info.java
file with its own syntax which has been introduced with the Java Platform Module System (JPMS) in Java 9. If the compiler compliance level is lower than 9 the token module at the beginning of a .java
file is a syntax error because module-info.java
is a regular Java file in Java <= 8.
Please note that the setting in eclipse.ini
refers to the JRE/JDK that is used to run Eclipse. The JREs or better (to see the source code) JDKs to use for development have to be specified in Window > Preferences: Java > Installed JREs.