IntelliJ IDEA JDK configuration on Mac OS

后端 未结 4 1491
無奈伤痛
無奈伤痛 2020-11-28 18:39

I am using IntelliJ IDEA 10. Every time when I create a new project, it is asking me to choose JDK for this project. Anyone know how I can configure it and make it easy to u

相关标签:
4条回答
  • 2020-11-28 19:12

    If you are on Mac OS X or Ubuntu, the problem is caused by the symlinks to the JDK. File | Invalidate Caches should help. If it doesn't, specify the JDK path to the direct JDK Home folder, not a symlink.

    Invalidate Caches menu item is available under IntelliJ IDEA File menu.

    Direct JDK path after the recent Apple Java update is:

    /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    

    In IDEA you can configure the new JSDK in File | Project Structure, select SDKs on the left, then press [+] button, then specify the above JDK home path, you should get something like this:

    JDK 1.6 on Mac

    0 讨论(0)
  • 2020-11-28 19:21

    Just tried this recently and when trying to select the JDK... /System/Library/Java/JavaVirtualMachines/ appears as empty when opening&selecting through IntelliJ. Therefore i couldn't select the JDK...

    I've found that to workaround this, when the finder windows open (pressing [+] JDK) just use the shortcut Shift + CMD + G to specify the path. (/System/Library/Java/JavaVirtualMachines/1.6.0.jdk in my case)

    And voila, IntelliJ can find everything from that point on.

    0 讨论(0)
  • 2020-11-28 19:33

    The JDK path might change when you update JAVA. For Mac you should go to the following path to check the JAVA version installed.

    /Library/Java/JavaVirtualMachines/
    

    Next, say JDK version that you find is jdk1.8.0_151.jdk, the path to home directory within it is the JDK home path.

    In my case it was :

    /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
    

    You can configure it by going to File -> Project Structure -> SDKs.

    0 讨论(0)
  • 2020-11-28 19:36

    On Mac IntelliJ Idea 12 has it's preferences/keymaps placed here: ./Users/viliuskraujutis/Library/Preferences/IdeaIC12/keymaps/

    0 讨论(0)
提交回复
热议问题