Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ doesn't Understand java libraries on Java9-ea

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

like image 498
Manish Jindal Avatar asked Jan 04 '17 09:01

Manish Jindal


People also ask

Which JDK version is best for IntelliJ?

Java 12 and IntelliJ IDEA.

How do I import an external library into IntelliJ?

From the main menu, select File | Project Structure | Project Settings | Modules. Select the module for which you want to add a library and click Dependencies. button and select Library. In the dialog that opens, select a project or a global library that you want to add to the module.

How to check which Java version IntelliJ is using?

IntelliJ stores the JDK version used by the project within its Project Structure. There are two ways to locate this: Via menu navigation: Navigating to File -> Project Structure.


2 Answers

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.

like image 90
Mark Rotteveel Avatar answered Oct 15 '22 14:10

Mark Rotteveel


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

like image 1
Erunafailaro Avatar answered Oct 15 '22 13:10

Erunafailaro