1

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 Answers4

5

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.

Teesquared
  • 61
  • 1
  • 3
4

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"
Reimeus
  • 158,255
  • 15
  • 216
  • 276
  • In this case, he might need the JDK and not the JRE - based on the error message he describes – Amir Afghani Dec 03 '13 at 23:17
  • @AmirAfghani Setting JAVA_Home to be the jdk gives me `Error loading: C:\Program Files\Java\jdk1.7.0_45\jre\bin\server\jvm.dll` –  Dec 03 '13 at 23:18
  • That was given as an example. What is the exact path where your JDK is installed? – Reimeus Dec 03 '13 at 23:19
  • `C:\Program Files\Java\jdk1.7.0_45`, which is what I set as JAVA_HOME` –  Dec 03 '13 at 23:20
  • what happens when you type %JAVA_HOME%\bin\java -version ? If that doesn't work, you haven't set JAVA_HOME properly – Amir Afghani Dec 03 '13 at 23:22
  • I get `C:\Program is not recognized...`, so perhaps the space is messing it up –  Dec 03 '13 at 23:25
  • I wrapped my `JAVA_HOME` variable in quotes, and now I can get the java version, but I still can't run compc. I'll update my question...done –  Dec 03 '13 at 23:28
  • Are you running `compc` in the same DOS window where you set `JAVA_HOME`? I would set the variable in the `System Properties Environment` Windows dialog – Reimeus Dec 03 '13 at 23:43
  • I set all the variables with the Windows dialog, and I open a new `cmd` window after every change. I even restarted my computer after my last edit –  Dec 03 '13 at 23:52
  • Are you using a 32-bit JDK? Also [this](http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fd9.html) may help – Reimeus Dec 03 '13 at 23:55
  • I'm using a 64-bit JDK –  Dec 03 '13 at 23:57
  • The [config doc](http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fd9.html) says _You must use a 32-bit version of the JDK_ – Reimeus Dec 03 '13 at 23:58
1

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.

B4dT0bi
  • 623
  • 4
  • 21
  • I get `Error loading: C:\Program Files\Java\jre7\bin\server\jvm.dll` after doing that –  Dec 03 '13 at 23:15
  • check this post : http://stackoverflow.com/questions/18123144/missing-server-jvm-java-jre7-bin-server-jvm-dll – B4dT0bi Dec 03 '13 at 23:43
  • That didn't help. I already have a folder called `server`, and I don't have a folder named `client` –  Dec 03 '13 at 23:51
0

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

Community
  • 1
  • 1
radistao
  • 14,889
  • 11
  • 66
  • 92