IntelliJ doesn't Understand java libraries on Java9-ea

898 views Asked by At

I am using jdk9-ea 149 and created a sample javafx application

IntelliJ doesn't understand the java libraries, It's shows all the import statement in red color and they are all grayed out.even for java.util.List, java.util.ArrayList it has the same issue.

I am able to compile form outside but i am not able to compile the code from IntelliJ 2016.3.2 Ultimate Edition.

It looks like we need to add some libraries to IntelliJ project but with java9 build 149 jigsaw i don't know how to do that.

Sample JavaFx Code On Intellij using jdk9-ea

I am using Experimental features still it doesn't understand the import statements - see intellij setting below

IntelliJ Version : IntelliJ 2016.3.2 Ultimate Edition Java Version: java 9-ea build: 149 enter image description here

2

There are 2 answers

0
Mark Rotteveel On

As mentioned in IntelliJ IDEA 2016.3.1 is Out:

Speaking of JDK 9, IntelliJ IDEA 2016.3 won’t support builds 148 and up because they contain code that breaks things. Of course, we’re working to resolve this, and will support the latest JDK 9 builds in 2017.1 (its EAP may well start within the next few weeks).

In IntelliJ IDEA 2017.1: Java 9, Kotlin 1.1, Spring, Gradle, JavaScript, Go and more it says:

The latest builds of JDK 9 are fully supported, with assisted project import and coding assistance for editing module declarations.

So if you are using Java 9 build 148 or higher, you need to use version 2017.1 or higher.

Alternatively, if you need to use an older version of IntelliJ, downgrade to Java 9 build 147 or lower.

0
Erunafailaro On

The latest version of IntelliJ IDEA, 2017.1, does support jdk 9.