Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to configure Java 11 to Intellij

I am using windows and configured environment variables for Java 11. On the terminal, java version is 11 as expected and I am to compile and run Java class files via the terminal.

On Intellij (Community Version 2018.3.5), used to have version 8 which worked fine. I am not able to get it to work since changing to version 11 (tested with brand new projects too).

Under project Structure, file path is set to C:\Program Files\Java\jdk-11 as expected.

Under Project settings/ module, version set to 1.11 JDK. Unable to change language level to 11. Max level possible is 9.

For Default Project settings, unable to select any options for target bytecode version.

When I try to run the main method, which has nothing but a print statement, I get following error message:

Error:Cannot run program "D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.3\jre64\bin\java" (in directory "C:\Users\username.IdeaIC2017.3\system\compile-server"): CreateProcess error=2, The system cannot find the file specified

Why is it looking at some weird space when my jdk path has been specified at C:\Program Files\Java\jdk-11 already?

Please advice what I am missing. Added some screen shots for reference.

UPDATE: My version is Community Version 2017.3.5. Refer to my comment below.

enter image description here

enter image description here

enter image description here

like image 738
kar Avatar asked Oct 12 '18 21:10

kar


1 Answers

2018.3.4 works fine for jdk > 1.8

enter image description here

The problem you are having is because of the settings that are being used

Error:Cannot run program "D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3.3\jre64\bin\java" (in directory "C:\Users\username.IdeaIC2017.3\system\compile-server"): CreateProcess error=2, The system cannot find the file specified

Reinstalling and not reusing the same settings from 2017 should work fine.

like image 162
Andrei Sfat Avatar answered Oct 25 '22 17:10

Andrei Sfat