MXMLC and 64bit JRE
Asked Answered
S

2

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).

Soubriquet answered 2/6, 2010 at 5:47 Comment(0)
K
86

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.

Kandrakandy answered 17/6, 2010 at 19:27 Comment(6)
Apparently the forward slashes are important; backslashes did not work on my Windows 7 machine.Rhombus
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.1Leifleifer
This is simply not true. You can't use the *.exe stubs but you can use a 64 bit JRE.Alyce
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.Crammer
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!Chrysarobin
For anyone needing it FLEX_HOME is usually in ECLIPSE_PATH\plugins\com.powerflasher.fdt.shippedflex_xxxx\flexDnieper
A
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
  • ...
Alyce answered 11/4, 2015 at 20:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.