1

I need to add my installed Java 11 version to the project settings, because of this error (Error:java: invalid source release: 11).

When i go to project structure -> Project settings -> Project there it just shows Java 1.8. When i try to add "java-11-openjdk-amd64" it fails with the reason "The selected directory points to a JRE, not a JDK.".

java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)

1 Answer 1

3

The java application is available in the Java Runtime Environment (JRE). The fact that java is available in version 11 does not necessarily mean that the Java Development Kit (JDK) is also installed for version 11. However, IntelliJ needs the JDK which includes tools like the compiler javac.

In order to use Java 11 in IntelliJ, you need to install the Java 11 JDK.

For example on Ubuntu you can do that by executing:

sudo apt install openjdk-11-jdk
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.