6

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

4
  • you are saying that you use 2018.3.5, but from the error message I see 2017. 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 Commented Oct 13, 2018 at 6:18
  • Installed Community 2018.2.4 and I have jdk 10 available imgur.com/a/YeCf5me . Works on EAP 2018.3. I think it has to do with your current settings Commented Oct 13, 2018 at 6:25
  • @sfat Oversight from me. Been always keeping Intellij up to date (most recently updated yesterday) or so I thought. Seems if you have a 2017 version.. it doesn't carry on to update to 2018 versions.. My version was 2017.3.5. Reinstalled 2018 version and it is working fine now. Thanks. Commented Oct 13, 2018 at 9:26
  • I added the answer for posterity if someone else bumps into the same issue. Glad you solved you problem Commented Oct 13, 2018 at 22:06

1 Answer 1

2

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.

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.