How do I run IDEA IntelliJ on Mac OS X with JDK 7?

2019-01-20 22:24发布

I use Mac OS X 10.8.2, and use JDK 7. Now I downloaded the latest version of IDEA IntelliJ, 11. But it doesn't seem to start without JDK 6. Is there any workaround?

How can I run IDEA IntelliJ on Mac OS X with JDK 7?

5条回答
Viruses.
2楼-- · 2019-01-20 22:44

With IntelliJ 13 and OS X 10.9, I can just change the plist to 1.7* and it works on Java 7 without prompting for the Java 6 install.

查看更多
ら.Afraid
3楼-- · 2019-01-20 22:46

UPDATE:

When running IDEA 12 on JDK 1.7 (after changing JVMVersion to 1.7* in Info.plist) make sure you have LANG=en_US.UTF-8 in your environment, see the related Java issues:

Refer to this thread for debugging launcher issues.

Please also be aware that GUI applications on Mac have no access to your Terminal environment. If you've defined some environment variables that work fine in Terminal, other applications that you run not from the Terminal will not see these variables. A workaround for this problem is to start the application directly from the Terminal, for IDEA the following command can be used:

open -a /Applications/IntelliJ\ IDEA\ 12.app/

There are known issues with JDK 1.7 support on Mac right now, like missing Retina support, possible flicker, some APIs not implemented. It's highly recommended to run IDEA under JDK 1.6 for the best experience on Mac. It doesn't stop you from using JDK 1.7 as a target for building and running your projects.


IntelliJ IDEA 11 launcher will not work with JDK 1.7 on Mac. At the moment you must have JDK 1.6 installed so that you can run IDEA 11 and older versions.

查看更多
Deceive 欺骗
4楼-- · 2019-01-20 22:49

Mac OSX Yosemite / El Capitan Update

I have IntelliJ 15 Ultimate installed, and I received this same message. I also have Java 1.7 and 1.8 installed.

I solved it using the following steps in a terminal:

$ cd /Applications/IntelliJ\ IDEA\ 14.app/Contents

Edited the Info.plist file, and changed this bit:

<key>JVMVersion</key>
<string>1.6*</string>

to:

<key>JVMVersion</key>
<string>1.8*</string>

After launching, everything was golden.

查看更多
霸刀☆藐视天下
5楼-- · 2019-01-20 22:53

Others have suggested very good solutions but you have to do it manually vi editor etc. Instead you can run this command via your Mac Terminal and you will be good to go :

find /Applications/IntelliJ*/*Contents/*Info.plist  -exec sed -i -e 's/string>1.6/string>1.7/' {} \;

enter image description here

Few optional tips:

  1. If you have JDK 1.8 installed then simply replace the 1.7 with 1.8 in above command.
  2. As always make a copy of your Info.plist in a folder just in case if you want to compare the result or revert it back for one reason or another.
  3. To verify that the change took place run this:

    • grep "string>1.7" /Applications/IntelliJ*/*Contents/*Info.plist
查看更多
狗以群分
6楼-- · 2019-01-20 23:09

For those who still getting error message that Java 6 must be installed. There are two problems with that:

  1. Mac OS wants jdk 1.6 to be installed whenever application Info.plist file contains Java section
  2. Java launcher shipped with IntelliJ also wants jdk 1.6 badly

All you need is:

  1. Replace original launcher (Contents/MacOS/idea) with shell script with explicit java invocation (parameters and classpath can be taken from Info.plist's Java section).
  2. Remove "Java" section from Info.plist

Or you can use this https://github.com/wonder-mice/mac-java-launcher that automate things and I believe will work not only with IntelliJ.

查看更多
登录 后发表回答