86

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?

grepit
  • 21,260
  • 6
  • 105
  • 81
Jonas
  • 121,568
  • 97
  • 310
  • 388
  • 3
    I faced similar issue when I installed JDK 8 and was able to fix it by changing JVMVersion value to 1.8* from 1.6* in the "/Applications/IntelliJ IDEA 13.app/Contents/Info.plist". – Mrugen Deshmukh Oct 22 '14 at 01:10

5 Answers5

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:

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.

drvdijk
  • 5,556
  • 2
  • 29
  • 48
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • Any news on this now when IDEA 12 is released? any workarounds? – Jonas Dec 09 '12 at 19:46
  • It works in IDEA 12, see [this post](http://devnet.jetbrains.net/message/5472745#5472745). – CrazyCoder Dec 09 '12 at 20:09
  • 4
    That doesn't work for me. When I change `JVMVersion` to `1.7*` and try to start IDEA 12, I still get the message that I need a JRE 6. – Jonas Dec 09 '12 at 21:35
  • Not sure what is the problem in your case, but it definitely works for me and other users. – CrazyCoder Dec 09 '12 at 22:51
  • 8
    This is not working for me either. Running a fresh install of Mountain Lion, Java 7 Update 10, IDEA 12 still asking for Java 6. Running `java -version` from Terminal works fine. Thoughts? – 9ee1 Jan 10 '13 at 04:56
  • @agarhy, IDEA may not see your Terminal environment because of the [Mac specifics](http://apple.stackexchange.com/q/57385/17551), try running it from the Terminal: `open -a /Applications/IntelliJ\ IDEA\ 12.app/` – CrazyCoder Feb 05 '13 at 12:55
  • 1
    Note for Retina owners, using JDK7 will work but the program will be rendered in **non retina resolution**, and the *NSHighResolutionCapable* trick won't work. Oracle will add Retina support in JDK 8, let's hope JDK8 will be indeed released in sept 2013. See http://lists.apple.com/archives/java-dev/2012/Oct/msg00144.html http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8000629 – bric3 Feb 07 '13 at 10:32
  • Does not work for me either, even by opening it from the terminal. but I have 12 CE, would that be an issue? – Isaac May 24 '13 at 02:55
  • @Is7aq, what is IDEA build number? Did you modify Info.plist file? Can you attach a file after modification? Do you have JAVA_HOME defined that points to JDK 1.7? If you need more help, contact support team for assistance, we have a guide how to debug launcher issues and make a log that will show why this specific JDK version was chosen and not another one. Downvoting the answer will not help you. – CrazyCoder May 24 '13 at 04:11
  • 2
    The retina issue was fixed in Java 7u40: http://stackoverflow.com/a/17029720/13365 – neu242 Oct 23 '13 at 11:39
  • @CrazyCoder Followed the instructions to a "T", but still get the same error. I read through the jetbrains thread you mentioned without seeing anything recent or relevant. My IntelliJ build string is `IntelliJ IDEA 12.1.6, build IU-129.1359`, java reports `build 1.7.0_45-b18`, and I'm on OS X 10.9. – Johann Jan 08 '14 at 03:55
  • 2
    After editing the plist, make sure to resign the app bundle to avoid a nagging prompt and intermittent hangs at startup. Create a [code-signing cert](https://developer.apple.com/library/mac/documentation/security/conceptual/CodeSigningGuide/Procedures/Procedures.html), and then run `sudo codesign --verbose --force --sign "" /Applications/WebStorm.app/` – tony19 Mar 16 '14 at 18:45
  • 1
    Changing JVMVersion to 1.8* worked for me, OS X 10.9.3, JDK 8u5, IntelliJ IDEA 13.1.3 – akauppi May 27 '14 at 06:15
  • @willjthomas this point is a bit obsolete, latest IDEA versions have special code to read the terminal environment on start. – CrazyCoder Oct 14 '14 at 21:41
  • @CrazyCoder: Why do we still need to edit `Info.plist` now in IntelliJ 14? ...will you never fix this? – Jonas Nov 11 '14 at 17:38
  • 2
    @Jonas, see the [official JetBrains answer](https://intellij-support.jetbrains.com/entries/27854363). – CrazyCoder Nov 13 '14 at 18:00
  • please note that running Idea with java 6 prevents the zk plugin from working correctly. – Riccardo Cossu Oct 10 '15 at 17:33
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.

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.

ddavison
  • 28,221
  • 15
  • 85
  • 110
  • 4
    "everything was golden" - yeah, except that the fonts now look absolutely terrible and eye-breaking – Sergio Tulentsev Jan 30 '15 at 07:13
  • For me with IntelliJ 14, OSX 10.10 and Java 7 or 8 it froze my Mac Air and I had bad hard resets and it needed up to 20 reboots to start up OSX again. Solution for me: uninstall all java versions. Install only java 1.6 from apple (http://support.apple.com/kb/DL1572). Install the needed SDK/JDK 7/8 and configure it in IntelliJ and Project Structure as needed. It was a really hard time for me to see my Mac Air not booting anymore. This problem should be communicated better by Oracle, Google and IDEA for IntelliJ and Android for Mac Users! Time cost for me: 4 hours. – Freddy Feb 27 '15 at 14:41
  • Previously when I did this i had an issue where my Mac wouldn't let me use my keychain for my teamcity and svn passwords because I modified the application folder. Do you know if this issue will pop up now? – Carlos Bribiescas Apr 14 '15 at 19:44
  • I have no idea @CarlosBribiescas, I've never had the issue – ddavison Apr 15 '15 at 11:41
  • This worked for me. The specific error message was "'tools.jar' seems to be not in IDEA classpath. Please ensure JAVA_HOME points to JDK rather than JRE". – jimoleary Oct 02 '15 at 20:13
  • Hi, it notices me to install the APPLE JRE after I set the JVMVersion to 1.7*, the tip is "the intellij unable to find a valid JVM" . but actually I have jdk 1.7 and 1.8 and the JAVA_HOME points to 1.7 version. Any solution for this ? – Frank Oct 10 '15 at 10:14
  • 1
    this is not the recommended way to run Idea with java 8 on Mac Os X. Please see the right way to do it: https://youtrack.jetbrains.com/issue/IDEA-126847 – Riccardo Cossu Oct 10 '15 at 17:35
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.

Spyder
  • 1,882
  • 13
  • 23
  • 1
    I just tried this on OS X 10.8.5, with Oracle JDK 1.7.0_45 and IntelliJ 13.0.2, and the fonts look awful. Sticking with JRE 6 for now! – Steve K Jan 28 '14 at 23:56
  • 2
    I just tried this on OS X 10.9.1 with Oracle JDK 1.7.0_51 and IntelliJ 13.0.2 and the fonts look great on a retina display. They looked blurry with JDK 1.7.0_25. Someone said Oracle fixed the issue in 1.7.0_40. Get the latest here: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html – jaredjacobs Feb 07 '14 at 18:04
  • sadly, hacking the plist causes the firewall to prompt every time IntelliJ loads: http://stackoverflow.com/questions/13578062/how-to-increase-ide-memory-limit-in-intellij-idea-on-mac/13581526#13581526 which is worse? Having JRE6 installed or a prompt on every IntelliJ load? :) – Spyder Mar 05 '14 at 00:04
  • 2
    @Spyder, Since the app signature changes after you change plist, you have to resign the app bundle to prevent the nagging prompt. For Webstorm, I created a code-signing cert in my login keychain (https://developer.apple.com/library/mac/documentation/security/conceptual/CodeSigningGuide/Procedures/Procedures.html), and then ran `sudo codesign --verbose --force --sign "" /Applications/Webstorm.app/` – tony19 Mar 16 '14 at 18:40
3

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.

wonder.mice
  • 7,227
  • 3
  • 36
  • 39
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 :

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
grepit
  • 21,260
  • 6
  • 105
  • 81