Trying to run ant - getting an error

I just installed ant and JDK 6 and am trying to run the ant task. I get the following:

C:\Users\Giles Roadnight\workspace\Parsley\build>ant compile_spicelib_complete_flex Buildfile: build.xml compile_spicelib_complete_flex: [exec] Error loading: C:\Program Files\Java\jdk1.6.0_17\jre\bin\server\jvm.dll [exec] Result: 6 BUILD SUCCESSFUL Total time: 0 seconds C:\Users\Giles Roadnight\workspace\Parsley\build> 

This file - jvm.dll definitely exists. I tried to work as an administrator with the same result.

To install, I ran the JDK installer (I already had JRE installed), I configured JAVA_HOME in my environment variables. I unpacked ant and added my ant bin directory to my PATH.

I do not know about Java and how it all works, so I lost this a bit.

I am on 64-bit windows 7. I downloaded the 64-bit JDK.

Any help is greatly appreciated.

+4
source share
4 answers

you have to have your flex unzipped in some folder. I mean this folder as flex_sdk.

Add flex_sdk to the FLEX_HOME environment variable (create an environment variable if necessary). The Flex compiler requires a 32-bit JRE, as there is currently no support for a 64-bit JRE. To do this, first download the 32-bit (or X86) version of jdk, and then specify the flex sdk point for it. To do this, you will need to edit the jvm.config file located in FLEX_HOME \ bin. In jvm.config, set java.home to the location of your 32-bit JDK, as shown. (Note that this is not a backslash)

Example: java.home=C:/Program Files (x86)/Java/jdk1.6.0_25 Alternatively, you can also add an environment variable named JAVA_HOME and point it to the above location if you cannot find the jvm.config file .

/ I had the same problem, and I researched this for a couple of days. Tried 100s class paths and a lot of corrupted registry problems. The above solution seems to have worked for me. Let me know if it works for you as well

-Prasad K

+11
source

It seems to me that the ant script runs its own program, which, in turn, tries to load the JVM to run some Java code and fails. I would suggest that there is a mismatch between the 32-bit and 64-bit versions. The package that you are trying to run in this theory uses a 32-bit Windows executable that cannot load LoadLibrary into a 64-bit JVM DLL.

A simpler explanation is that many things in a Java universe become confused spaces in path names. Try setting the JDK to a path name with no built-in spaces.

+4
source

You can solve this problem by creating a bat file in the bin-sdk bin directory with the following:

 "%JAVA_HOME%\bin\java.exe" -Xmx384m -Dsun.io.useCanonCaches=false -jar "%~dp0\..\lib\mxmlc.jar" +flexlib="%~dp0\..\frameworks" %* 

Then call this bat file instead of mxmlc.exe

Note: solution found at https://web.archive.org/web/20120327204229/http://sray.squidpower.com/2010/01/13/solution-to-error-running-mxmlcexe-with-windows-64bit -jvm /

+2
source

The first part that surprises me is that it tries to use the JVM server instead of the usual one, but this may be a feature of your build. Secondly, I will try to run ant -v instead of the usual ant. This should give you a lot more information and hopefully more information about what ant is trying to execute at a given time.

0
source

All Articles