29

Are there any workarounds to get the Flex compiler to work with a 64bit JRE? If I use an MXMLC task in an Ant buildfile in Eclipse it works fine but if I try to use MXMLC from the command line (or try the Run... command from FDT in Eclipse) it fails, telling me ...

"Error loading: C:\Program Files\Java\jrrt-1.6.0\jre\bin\jrockit\jvm.dll"

(this is with a 64bit JRockit runtime but that shouldn't matter).

BadmintonCat
  • 9,416
  • 14
  • 78
  • 129

2 Answers2

85

There is currently no support for using the Flex compiler with the 64 bit JRE. Instead, have the compiler use a 32 bit JRE.

To do so, you'll need to edit the jvm.config file located in FLEX_HOME\bin. Within jvm.config, set java.home to the location of a 32bit JRE. If you don't already have a 32bit JRE, download it.

Example:

java.home=C:/Program Files (x86)/Java/jre6

If you like this answer, please click the up arrow to the left.

Julian A.
  • 10,928
  • 16
  • 67
  • 107
  • 6
    Apparently the forward slashes are important; backslashes did not work on my Windows 7 machine. – Garret Wilson Jan 18 '12 at 16:22
  • I have the same problem, but not solved by a 32 bit JRE, I installed a 32 bit JRE(1.8.0_25) and set home but still same. My flex version is 4.0.1 – Lalith J. Dec 28 '14 at 09:17
  • 1
    This is simply not true. You can't use the *.exe stubs but you can use a 64 bit JRE. – bebbo Jun 07 '15 at 20:00
  • 1
    I don't see why this has so many upvotes, as it does not answer the question posted. There IS a workaround. See @bebbo's correct answer. mxmlc is just a Java jar file that doesn't care which JVM you have installed. It's only not "supported" because it was never worth it to Adobe since 99% of flash installations are still in 32-bit browsers. – Ryan Bemrose Jan 24 '16 at 11:16
  • Works if the path to the 32bit-JRE is specified in the global JAVA_PATH variable. NOT working if the same path is specified in the jvm.config file.. :p howsoever .. finally works :) Thank you! – Christopher Stock Jan 13 '17 at 07:06
  • For anyone needing it FLEX_HOME is usually in ECLIPSE_PATH\plugins\com.powerflasher.fdt.shippedflex_xxxx\flex – Yule Feb 03 '17 at 12:34
7

You can use any 64 bit Java but you need a batch file instead of the exe file to invoke java without the 32 bit stub. Create the bat files in the flex\bin folder.

mxmlc.bat:

@echo off
for  %%i in (%0) do set FLEX_HOME=%%~dpi..
java -jar "%FLEX_HOME%\lib\mxmlc.jar" +flexlib="%FLEX_HOME%/frameworks" %*

compc.bat:

@echo off
for  %%i in (%0) do set FLEX_HOME=%%~dpi..
java -jar "%FLEX_HOME%\lib\compc.jar" +flexlib="%FLEX_HOME%/frameworks" %*

Rinse and repeat for all other flex *.exe files.

Also add java options as needed, e.g.

java -Xmx2000m -XX:MaxMetaspaceSize=512m -jar "%FLEX_HOME%\lib\... ...

Now use

  • mxmlc.bat instead of mxmlx.exe
  • compc.bat instead of compc.exe
  • ...
bebbo
  • 2,830
  • 1
  • 32
  • 37