Compc "could not find a JVM"

9.9k views Asked by At

When I try to use compc to build a .swc, I get Error: could not find a JVM.

I found this site, and then commented out the java.home line. That didn't help.

I'm trying to build a .swc out of this library, so I can actually use it. I also have FlashBuilder, if I can build or add this library to my project through that instead, that would be nice.

EDIT: Setting JAVA_HOME to the jre or jdk directories gives me variations of a different error Error loading: C:\Program Files\Java\jdk1.7.0_45\jre\bin\server\jvm.dll

EDIT 2: After wrapping JAVA_HOME in strings, I get the error I had before I downloaded the JDK:

Error: could not find JRE
Error: could not find Java 2 Runtime Environment.

I can type%JAVA_HOME%\bin\java -version and see java version "1.7.0_45, however.

Replacing JAVA_HOME with the path to the JRE doesn't help.

EDIT 3 After installing and setting JAVA_HOME to the 32-bit sdk, I get this error:

C:\Users\Jim\Downloads\as3httpclient-master\as3httpclient-master\build-swc.xml(14): Error: unable to open 'C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks/libs/player/9/playerglobal.swc'

</external-library-path>

I noticed that the file path uses switches from using backslashes to forward slashes, so I changed them back, but that didn't help.

4

There are 4 answers

12
Reimeus On BEST ANSWER

C:\Program Files\Java is typically the directory into which the JDK is installed. Set the environmental variable to a specific JDK, for example

set JAVA_HOME="C:\Program Files\Java\jdk1.7.0_45"
3
B4dT0bi On

The JAVA_HOME should point to the JRE/JDK you want to use as it is possible to store more than 1 jvm in C:\Program Files\Java . If you are using Java 7 your JAVA_PATH should point to C:\Program Files\Java\jre7 for example.

1
Teesquared On

I had this same problem and my fix was to change the back slashes to forward slashes for the java.home setting in jvm.cfg.

So in "flexsdk/bin/jvm.config" change,

java.home=C:\Program Files (x86)Java\jre7

To,

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

And now compc, etc, can find the JVM and work.

0
radistao On

It is a problem of Flex mxmlc and compc compilers: the can't use x64 JDK, use i586 (IA32) JDK versions. See more here:

https://stackoverflow.com/a/3064938/907576