I am running IntelliJ IDEA 2017.1.6 Pro on a Linux (Ubuntu) machine and, it will not let me select an SDK for any Java project.
Whenever I start up the program and go to "Create a New Project" Java has no SDKs available. If go to new and try to specify where my JDKs are installed (I have a few) it always fails with the same error:
I've tried specifying the locations:
- /usr/lib/jvm/
- /usr/lib/jvm/java-11-openjdk-amd64/
- /usr/lib/jvm/java-8-openjdk-amd64/
- /usr/lib/jvm/openjdk-11/
- /usr/lib/jvm/jdk-14.0.2/
- /usr/lib/jvm/default-java
- /usr/lib/jvm/java-1.11.0-openjdk-amd64
- /usr/lib/jvm/java-1.8.0-openjdk-amd64
(these last three are all just symlinks)
I know I have a JDK installed for my default Java version. I can compile and run code via command line:
justin@stephanie:~/temp$ ls
HelloWorld.java
justin@stephanie:~/temp$ javac HelloWorld.java
justin@stephanie:~/temp$ ls
HelloWorld.class HelloWorld.java
justin@stephanie:~/temp$ java HelloWorld
Hello, World!
The output of readlink -f $(which java)
is /usr/lib/jvm/java-11-openjdk-amd64/bin/java
(same location for javac
exectuable).
Everything I've looked at online suggest that I should just be able to select /usr/lib/jvm/java-11-openjdk-amd64
as my Java SDK but it is failing. I feel like I must be misunderstanding something essential here as I don't know why this isn't working.
Any help would be useful, I've never used IntelliJ before (I've always been an Eclipse user) and it is very frustrating I can't even create a project in it after a couple hours of trying to mess around with it.