如何在Mac OS X上使用JDK 7运行IDEA IntelliJ ?

时间:2022-11-08 01:08:23

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?

我使用的是Mac OS X 10.8.2,并使用JDK 7。现在我下载了最新版本的IDEA IntelliJ, 11。但是,没有JDK 6,它就不可能启动。有什么解决方法吗?

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

如何使用JDK 7在Mac OS X上运行IDEA IntelliJ ?

5 个解决方案

#1


74  

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:

当在JDK 1.7上运行IDEA 12(在Info.plist中更改JVMVersion到1.7*之后)确保您拥有LANG=en_US。在您的环境中使用UTF-8,请参阅相关的Java问题:

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:

请注意,在Mac上的GUI应用程序无法访问您的终端环境。如果您已经定义了一些在终端中运行良好的环境变量,那么您从终端运行的其他应用程序将看不到这些变量。解决这个问题的方法是直接从终端启动应用程序,因为可以使用以下命令:

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.

现在有一些已知的问题,比如JDK 1.7对Mac的支持,比如缺少视网膜支持,可能闪烁,一些api没有实现。强烈建议在JDK 1.6中运行关于Mac的最佳体验,它不会阻止您使用JDK 1.7作为构建和运行项目的目标。


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.

IntelliJ IDEA 11启动器不会在Mac上使用JDK 1.7,目前您必须安装JDK 1.6,以便运行IDEA 11和旧版本。

#2


68  

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.

我已经安装了IntelliJ 15,我收到了同样的信息。我还安装了Java 1.7和1.8。

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:

编辑的信息。plist文件,并改变了这个位:

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

to:

:

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

After launching, everything was golden.

发射后,一切都是金色的。

#3


27  

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.

使用IntelliJ 13和OS X 10.9,我可以将plist更改为1.7*,它在Java 7上运行,而无需提示Java 6安装。

#4


3  

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

对于那些仍然收到错误消息的人,Java 6必须安装。这有两个问题:

  1. Mac OS wants jdk 1.6 to be installed whenever application Info.plist file contains Java section
  2. Mac OS希望在应用程序信息时安装jdk 1.6。plist文件包含Java部分。
  3. Java launcher shipped with IntelliJ also wants jdk 1.6 badly
  4. 与IntelliJ一起发布的Java launcher也很想要jdk 1.6。

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. 使用带有显式java调用的shell脚本替换原始启动程序(内容/MacOS/idea)(可以从Info中获取参数和类路径)。plist的Java部分)。
  3. Remove "Java" section from Info.plist
  4. 从Info.plist中删除“Java”部分。

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.

或者您也可以使用这个https://github.com/wonder-mice/mac-java-launcher来实现自动化,我相信它不仅可以使用IntelliJ。

#5


2  

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 :

其他人已经提出了很好的解决方案,但是你必须手动vi编辑器等等。相反,你可以通过你的Mac终端运行这个命令,你将会很好地去:

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

如何在Mac OS X上使用JDK 7运行IDEA IntelliJ ?

Few optional tips:

一些可选的小贴士:

  1. If you have JDK 1.8 installed then simply replace the 1.7 with 1.8 in above command.
  2. 如果您已经安装了JDK 1.8,那么只需在上面的命令中替换1.7和1.8。
  3. 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.
  4. 像往常一样复制你的信息。如果您想要比较结果或出于某种原因将其还原,请在文件夹中使用plist。
  5. To verify that the change took place run this:

    为了验证所发生的变化,运行如下:

    • grep "string>1.7" /Applications/IntelliJ*/*Contents/*Info.plist
    • grep "字符串> 1.7 " /应用程序/ IntelliJ * / * / * Info.plist内容

#1


74  

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:

当在JDK 1.7上运行IDEA 12(在Info.plist中更改JVMVersion到1.7*之后)确保您拥有LANG=en_US。在您的环境中使用UTF-8,请参阅相关的Java问题:

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:

请注意,在Mac上的GUI应用程序无法访问您的终端环境。如果您已经定义了一些在终端中运行良好的环境变量,那么您从终端运行的其他应用程序将看不到这些变量。解决这个问题的方法是直接从终端启动应用程序,因为可以使用以下命令:

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.

现在有一些已知的问题,比如JDK 1.7对Mac的支持,比如缺少视网膜支持,可能闪烁,一些api没有实现。强烈建议在JDK 1.6中运行关于Mac的最佳体验,它不会阻止您使用JDK 1.7作为构建和运行项目的目标。


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.

IntelliJ IDEA 11启动器不会在Mac上使用JDK 1.7,目前您必须安装JDK 1.6,以便运行IDEA 11和旧版本。

#2


68  

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.

我已经安装了IntelliJ 15,我收到了同样的信息。我还安装了Java 1.7和1.8。

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:

编辑的信息。plist文件,并改变了这个位:

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

to:

:

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

After launching, everything was golden.

发射后,一切都是金色的。

#3


27  

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.

使用IntelliJ 13和OS X 10.9,我可以将plist更改为1.7*,它在Java 7上运行,而无需提示Java 6安装。

#4


3  

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

对于那些仍然收到错误消息的人,Java 6必须安装。这有两个问题:

  1. Mac OS wants jdk 1.6 to be installed whenever application Info.plist file contains Java section
  2. Mac OS希望在应用程序信息时安装jdk 1.6。plist文件包含Java部分。
  3. Java launcher shipped with IntelliJ also wants jdk 1.6 badly
  4. 与IntelliJ一起发布的Java launcher也很想要jdk 1.6。

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. 使用带有显式java调用的shell脚本替换原始启动程序(内容/MacOS/idea)(可以从Info中获取参数和类路径)。plist的Java部分)。
  3. Remove "Java" section from Info.plist
  4. 从Info.plist中删除“Java”部分。

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.

或者您也可以使用这个https://github.com/wonder-mice/mac-java-launcher来实现自动化,我相信它不仅可以使用IntelliJ。

#5


2  

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 :

其他人已经提出了很好的解决方案,但是你必须手动vi编辑器等等。相反,你可以通过你的Mac终端运行这个命令,你将会很好地去:

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

如何在Mac OS X上使用JDK 7运行IDEA IntelliJ ?

Few optional tips:

一些可选的小贴士:

  1. If you have JDK 1.8 installed then simply replace the 1.7 with 1.8 in above command.
  2. 如果您已经安装了JDK 1.8,那么只需在上面的命令中替换1.7和1.8。
  3. 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.
  4. 像往常一样复制你的信息。如果您想要比较结果或出于某种原因将其还原,请在文件夹中使用plist。
  5. To verify that the change took place run this:

    为了验证所发生的变化,运行如下:

    • grep "string>1.7" /Applications/IntelliJ*/*Contents/*Info.plist
    • grep "字符串> 1.7 " /应用程序/ IntelliJ * / * / * Info.plist内容