Proper way to use JDK6 for IntelliJ IDEA itself on Mac OS X
I'm new to mac os x, so I'm not sure how to set IntelliJ IDEA 8 to run on JDK6 instead of JDK5 which the "About IntelliJ IDEA" menu item says I'm using. What's the proper way for doing this? I went to Applications -> Utilities -> Java -> Java Preferences and made Java SE 6 the top position for both the preferred Applet version and Java application version. But that hasn't affected IntelliJ IDEA... What do I do?
Tomcat also defaulted to JDK5, I had to look for JDK6 and set the JRE_HOME environment variable to "/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home" before starting tomcat in order to get it to use JDK6. I want EVERYTHING to run on JDK6!! But I'd be happy with at least intellij for now...
Please sign in to leave a comment.
Scott,
Do you have IntelliJ in the Dock? If so, CMD+CLICK it and it will open the Applications folder with the app highlighted. (nice tip, eh? :-) ) Right-click the app, and choose "Show Package Contents...". Double click the Contents directory. Now you want to edit the Info.plist file. Either double click it to open it in the plist editor (not sure if you have to have the Apple developer tools to get this editor or not), or open it in a text editor (this particular plist file is in XML format). Find the Java section, and the entry for JVMVersion. Change 1.5* to 1.6*, restart IntelliJ, and you're all set.
Note that some have reported trouble with using IntelliJ with 1.6. You may need to increase the maximum amount of memory that the JVM uses. You can achieve that within the Info.plist file as well.
Thank you Paul, you helped me learn a couple tricks with mac os x too . Why does IntelliJ default to 1.5? They're having memory issues with 1.6? Or 1.6 just consumes more memory without adding much new?
I'm really not sure why the default is 1.5. Any idea if it's the same for other platforms? I read someshwere that JDK 1.6 on OS X is buggy, but I haven't confirmed this yet.
Hello Paul,
On other platforms the default JDK is 1.6. On MacOS X the JDK 6 is 64-bit
only (which means significantly larger memory consumption) and less stable
than JDK 1.5.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
1.6 has been working great for me. It's interesting that you mentioned IntelliJ uses more ram on 1.6 and I read that elsewhere on these forums too. However, I see it using a little less ram in general. Haven't performed any real tests of this, but certainly any more ram it uses is not noticeable.
Does that also mean, on Win64 it is better to take the 32-bit or 64-bit Java
1.5 because it is more stable than 64-bit Java 1.6?
Tom
No. The stability problems are specific to the Apple version of the 1.6 JDK. On Windows, Java 1.6 is more stable than Java 1.5.
Maybe this is why I didn't see any extra memory usage in switching from jdk 5 to 6, I was using the 64-bit version of jdk 5...
Changing Info.plist with 'vi' as you described results in an error when starting IntelliJ. If I do 'open -a /Applications/IntelliJ\ IDEA\ 8.1.app', it gives the error
LSOpenFromURLSpec() failed with error -10810.
No matter what I try (1.6 without the asterisk, 1.4), it only seems to run when 1.5* is given...
Same issue here. I get the following on the logs:
6/15/09 8:32:05 PM [0x0-0x3e03e].com.jetbrains.intellij[454] [JavaAppLauncher Error] unable to find a version of Java to launch
6/15/09 8:32:05 PM com.apple.launchd[131] ([0x0-0x3e03e].com.jetbrains.intellij[454]) Exited with exit code: 1
6/15/09 8:32:33 PM [0x0-0x40040].com.jetbrains.intellij[457] [JavaAppLauncher Warning] Java application launched from PPC or bad stub. Relaunching in 32-bit, and tagging sub-processes to prefer 32-bit with $JAVA_ARCH=i386.
6/15/09 8:32:33 PM [0x0-0x40040].com.jetbrains.intellij[457] [JavaAppLauncher Warning] Java application launched from PPC or bad stub. Relaunching in 32-bit, and tagging sub-processes to prefer 32-bit with $JAVA_ARCH=i386.
6/15/09 8:32:34 PM [0x0-0x40040].com.jetbrains.intellij[457] [JavaAppLauncher Error] This process is [i386] and was re-exec'd from [i386], but for some reason we are trying re-exec to [].
Apple has only provided JDK 6 for 64-bit Intel Macs running Mac OS X 10.5. PPC (32 and 64 bit) and older Intel (32 bit) Macs cannot use JDK 6.
There is a rumor that Apple will provide a 32-bit JDK 6 for Intel Macs in Snow Leopard, but I'll believe it when I see it. There will never be an Apple-provided PPC JDK 6.
Landon Fuller has done work on getting OpenJDK 6 to run on the Mac:
http://landonf.bikemonkey.org/code/java/OpenJDK6_MacPorts.20090516.html
I was kinda-sorta able to get it to run IntelliJ on my 32-bit Intel iMac, but I wouldn't use it for everyday use.
Jon
I am using Core 2 Duo computers, with full 64 bit support. I used JDK6 with older versions of IDEA a few months ago.
I think that your comment pinpoints what he issue might be here. The IDEA launcher, for some reason, can't find the JDK6 on my computer. That is actually why it doesn't work. But that JDK is there and fully functional.
This could just be a bug in the lanucher.
yes, this used to work but now i'm getting the same error. they've changed something in the launcher, i've tried a dozen different things and can't get IntelliJ to find JDK6... i get the same messages as in your post in the console
I used the JDK6 for months until 1 week ago. After installing a new java update (http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_4) the launcher isn't able to find the JDK6 anmore .. hmm, not sure where exactly the problem is. I'll try if I can remove that update, because I can't work on my projects with JDK5... :-(
You no need launch IntelliJ with JDK 6 if you want to use this JDK in your projects. My IntelliJ working with JDK 5 and all projects use JDK 6 without any problems. All you need is set JDK 6 in Project Settings as Project JDK.
Ok, that seems to work indeed. Thanks for your help. But what doesn`t work completly now is the JFormDesigner-PlugIn: When a form which contains beans from other modules in the project (all set to language level and jdk 6) JFormDesigner throws a UnsupportedClassVersionError exception for each occurence:
java.lang.UnsupportedClassVersionError: Bad version number in .class file
Ok, so it seems as JFormDesigner is the one having problems with this (as far as I remember I set the JDK for IntelliJ to 1.6 in the plist in order to to fix that).
the suggestion in this thread worked for me
http://www.jetbrains.net/devnet/message/5240216#5240216
also works for me, great! thanks!
The proposed solution worked for me too. Wrote a small article about all the necessary steps to run Idea with JDK6 on OSX: Mac OS X: Using IntelliJ IDEA on 64bit JDK6