2

I am trying to create a new JavaFX project. I have 1.8 installed which I believe includes the javafx packages. Running javac -version in the terminal shows javac 1.8.0_121. I installed from here

When I go to File -> Project Structure -> Project the selected version is 1.6. There is no 1.8 version in the list. If I select add new, and navigate to /System/Library/Frameworks/JavaVM.framework/Versions I see:

1.4
1.4.2
1.5
1.5.0
1.6
1.6.0

There is no 1.8 version.

How can I update IntelliJ to user version 1.8?

5
  • 1
    I'm no Mac expert but /System/Library/Frameworks/JavaVM.framework/Versions does not sound like the path of the JDK.
    – Michael
    Feb 7, 2017 at 15:18
  • After a bit of googling, /System/Library/Java/JavaVirtualMachines/ sounds like the place to look.
    – Michael
    Feb 7, 2017 at 15:23
  • @Michael there is no /System/Library/Java/JavaVirtualMachines directory. I'm on El Capitan if that helps. How can I find out where it's stored? Feb 7, 2017 at 16:06
  • @Michael i.imgur.com/GPn1net.png ... Doesn't exist. Feb 7, 2017 at 16:23
  • Maybe you must configure your IDE to use that location? stackoverflow.com/questions/18987228/…
    – FibreFoX
    Feb 8, 2017 at 13:14

3 Answers 3

6

The location for the SDK can be found by running: echo $(/usr/libexec/java_home)

Which reveals:

/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
1
1

If you have installed Java with brew. /Users/{username}/.sdkman/candidates/java/current

To show .sdkman in finder

Press Cmd+Shift+. to show hidden files in the file chooser dialog. https://guides.codepath.com/android/setting-up-intellij-idea

0
0

Quite late to this party, today I had the same problem. The right answer I think is use jenv

brew install jenv openjdk@8
jenv add /usr/local/opt/openjdk@8

And then add into Intellij IDEA as new SDK the following path:

~/.jenv/versions/1.8/libexec/openjdk.jdk/Contents/Home/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.