Trying to run ant - getting error
I have just installed ant and JDK 6 and am trying to run an 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>
That file - jvm.dll is definitely there. I have tried running as an administrator with the same result.
To install I ran the JDK installer (I already had a JRE installed), I set up JAVA_HOME in my environment variables. I unzipped ant and added my ant bin directory to my PATH.
I am clueless about Java and how it all works so am a bit lost with this.
I am on 64 bit windows 7. I downloaded a 64 bit JDK.
Any help much a开发者_高级运维ppreciated.
you must have Unzipped your flex to some folder. I am referring to this folder as flex_sdk.
Add flex_sdk to the FLEX_HOME environment variable (creating the environment variable if necessary). Flex compiler needs a 32 bit JRE since there is currently no support for 64 bit JRE. For this, first download a 32 bit(or X86) version of jdk and later have the flex sdk point to it.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 your 32 bit JDK as shown.(Note that these are not backslashes)
Example: java.home=C:/Program Files (x86)/Java/jdk1.6.0_25
Alternatively, you can also add an environment variable with the name JAVA_HOME
and have it point to the above location if you are not able to find the jvm.config file.
/I had the same problem and researched on this for a couple of days. Tried 100s of classpaths and loads of corrupted registry issues. The above solution seemed to work for me. Let me know if it works for you as well/
-Prasad K
It looks to me as if the ant script is running a native program which in turn tries to load the JVM to run some java code, and fails. I would guess that there is a mismatch between 32-bit and 64-bit-ness. The package you are trying to run is, in this theory, using a 32-bit Windows executable which is failing to LoadLibrary the 64-bit JVM DLL.
A simpler possible explanation is that many things in the Java universe get befuddled by spaces on pathnames. Try installing the JDK in a pathname with no embedded spaces.
You can solve this by creating a bat file in the flex-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 invoke 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/
The first part that surprises me is that it tries to use the server JVM instead of the regular one, but that might be a feature of your build. The second thing I'd try is to run ant -v
instead of plain ant. This should give you a lot more output and hopefully more information as to what ant is trying to do at this point in time.
精彩评论