Jared Rypka-Hauer wrote his first from-scratch application in Commodore Basic at the age of 9. In his teens, he dabbled in everything from dBase to HyperCard and was instrumental in the development of several commercial software products. In 1990, he began his professional IT career, spending the first 8 years primarily in end-user support and Infrastructure. Since 1998, his interests have revolved around ColdFusion and dynamic web applications. Finally making the jump to using OO methods for web development in January of 2005, he's become a presence in the web-development blogging community and has written for outlets such as FusionAuthority and ColdFusion Developer's Journal. Jared is also the primary organizer of the CF.Objective conference.
Over the course of the last 48 hours I've been trying to nail down the last few issues in moving to OSX 10.5 64-bit. I've run into ColdFusion/Apache 2.2 configuration issues (that's a whole other blog post), I've run into issues that one always runs into when changing systems, and I ran into one file, and potentially excruciating issue that I want to address here. That issue is (in my opinion incorrectly) addressed in Adobe technote kb405284 titled "Flex Builder 3.x not supported with 64 bit Java 1.6 on Mac OS X" wherein Adobe asserts that the only solution to running FlexBuilder 3 on OSX is to revert the JVM to the 32-bit Java 1.5.0 that comes with the computer. This posed a serious dilemma.
I had just spent 12 hours getting around install issues, connector config issues, migration issues, and the rest of the issues that you encounter with a major change, and I wasn't about to sacrifice my ability to run 64-bit ColdFusion for the sake of FlexBuilder 3. So I started experimenting... shell scripts are marvelous things that I've been playing with a lot lately and I tried swapping VMs around before launching apps, I tried launching applications with explicit paths to the JVM I wanted it to use, I tried all kinds of things. Then, in a brief IM conversation with my friend Simeon Bateman, he reminded me that launch-time directives go in the .ini file included with the install.
So I ran off to do a bit more Googling, which led me to this post in the Eclipse wiki, dealing specifically with Eclipse.ini. On OSX, it's located at /Applications/Adobe Flex Builder3/Flex Builder.app/Contents/MacOS/FlexBuilder.ini, and it's sooooo easy to specify the VM you want to use:
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0
-vmargs
-Xdock:icon=../Resources/flexbuilder.icns
-Xdock:name=Flex Builder
-XstartOnFirstThread
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m
-XX:PermSize=64m
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Dorg.eclipse.swt.internal.carbon.noFocusRing
Those first 2 lines: "-vm /path/to/your/vm/1.x.x" Yeah, that's it.
The only gotcha is that they have to be on separate lines in the .ini file and they have to appear before the -vmargs directive because everything after that is passed as VM arguments when Java is being launched.
If you're running Eclipse proper, the same concept applies only it should be at /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini, or you can launch Eclipse using the symlink located at /Appplications/eclipse/eclipse and pass the -vm argument directly in (but why on earth would you want to do that?)
The reason I say that the above-mentioned Adobe KB article is incorrect is for a couple of reasons:
This post saved me A LOT of time.
Thanks!
I ended up changing my java prefs back to 1.5 just so the install would work. Then I changed the prefs as you described and move my global java prefs back to 1.6.
@Nick you have to put it on the newline like the example. It works like a charm if you do. Otherwise seems to ignore it.
THANK YOU!!!
The error in Flex is useless, and searching Adobe's technotes/forums yields very little.
this is great, thanks jared. just for google's sake, i found this article after looking at this one:
http://steve-brown.id.au/it-stuff/programming/eclipse-line-numbers-not-scrolling-on-osx.html
oddly, my line numbers stopped scrolling tonight while working in Flex Builder 3.0.2. the above article told me it was likely an issue with eclipse using the 64-bit JVM instead of 32-bit, and this article showed me how to explicitly point FB at the 32-bit JVM (1.5).
all better now.
Hey, really nice post.
In order to get the Red5 Flash Server running, I needed the 1.6 JVM, unfortunately I realized too late that Flex doesn't play well...
I tried following your instructions, however Flex still dies on bootup.
JVM terminated.
Exit code=-1
....
I even explicitly changed my Java version back to 1.5.0, by going to:
/System/Library/Frameworks/JavaVM.framework/Versions
and doing a ln -s 1.5.0 to both Current and CurrentJDK.
Doing a java -version, I get:
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)
So things look right, but not sure why Flex doesn't pick up the change. Any ideas?
Thank you very much!
Posted By: Nick on May 19, 2009 at 12:00 AM