Reputation: 309
Maybe I understand something wrong, but I am confused.
When I run /usr/libexec/java_home -V
I get:
9.0.4, x86_64: "Java SE 9.0.4" /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
1.8.0_161, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
But running java -version
logs:
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
But in eclipse I get a lot of similar build errors. One of them is
(package javax.jws is declared in module java.xml.ws, which is not in the module graph)
Why is Eclipse using java 9 to compile the project? How can I set JAVA 8 to compile the project instead of Java 9?
I have set the java compiler to 1.8 in Eclipse but anyway I get a lot of module errors. Why?
Upvotes: 1
Views: 414
Reputation: 7968
Right click on your project select build path -> configure build. In the opening window, there is JRE system library entry, edit it to point jdk8.
Upvotes: 1