What JRE version does Flex Builder 2 standalone use?

Posted on June 27, 2006 | 4 comments

With the release of the Flex Builder 2 Java technote I became curious of all the JVM settings in the standalone version. Here are my results and a method of switching the JVM used by the standalone builder.

This is not necessarily recommend or throughly tested, but its pretty basic stuff.

First is to check out the version that comes with the Flex Builder 2 standalone version. You can do this in two ways.

Way #1:
Open up a command prompt and type in “C:\Program Files\Adobe\Flex Builder 2\jre\bin>java -version”. You should see something like this,

java version “1.4.2_09″
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-b05)
Java HotSpot(TM) Client VM (build 1.4.2_09-b05, mixed mode)

Way #2:
Open up Flex Builder 2 and go to Help -> Product Details… -> Configuration Details and do a search on “java.runtime.version=”. You’ll file the same “1.4.2_09″

Ok now for changing out the JRE. Close the Flex Builder 2 and clear any process running that might be using the left jre/bin/java.exe. Then go into “C:\Program Files\Adobe\Flex Builder 2″ make a backup of the “jre” folder. The delete out the file (I had to shutdown a lot of process to do it). Then copy over the jre folder from they newer Sun install, you’ll want to use Sun’s Java JRE/JDK 1.4.2_10 or earlier or 1.5.0_05 or earlier as the technote states.

I tested it a little and things to seem to be fine, I’ll leave mine with the newer 1.5.0_06 jre I have installed and post any problems. But either way some further tests could be done to see if there is a performance gain.

Another note, the “C:\Program Files\Adobe\Flex Builder 2\FlexBuilder.ini” file lets you set the Java args. This is important for performance also. If you are working with large applications and know about how Java’s JVM does garabage collection you can set the Xms and Xmx to your desired values. Sun’s defaults are 64Mb a piece, and I see that the FlexBuilder.ini defaults them to 128M and 512M. If you have more Ram on your machine you can try pushing this values higher, but keep them divisible by 8 of course. And you do not need to go over roughly 1400M on windows because of a limitation of the Java JVM’s heap size.

  • http://alex.muntean.name Alex Muntean

    An easier way to change the JVM used by Flash Builder 2 is to add the -vm switch to FlexBuilder.ini like this:


    -vm
    c:\Program Files\Java\jre1.5.0_07\bin\javaw.exe

    -vmargs
    -Xms128M
    -Xmx512M
    -XX:MinHeapFreeRatio=20

  • http://www.renaun.com Renaun Erickson

    Thanks, this is a much cleaner way and most likely the preferred way of changing JVM’s.

  • http://www.anya-and-stephen.com/pages/java.jsp Stephen

    Actually, adding it to the .ini file is not enough.

    You need to create a desktop shortcut(assuming Windows), and change your target like so:

    “C:\Program Files\Adobe\Flex Builder 2\FlexBuilder.exe” -vm “C:\Program Files\Java\jre1.6.0\bin\javaw.exe”

    How do I know?
    I wanted to be sure…so after adding -vm to the .ini, I opened Process Explorer and checked the loaded files running under FlexBuilder.exe process. Sadly, my jre 1.6 wasn’t loaded.

    It seems that -vm is ignored when they attach switches to the eclipse rcp executable.

    If you do it my way, and you check process explorer, you will see that jre 1.6 is used.

    HTH,
    Steve

  • http://srikanthmadduri.com Srikanth Madduri

    I followed this to point FlashBuilder 4 Beta 2 to Java 1.5 and it worked fine. This was so helpful. Thank you!