After installing the newer version of the JDK 6 (1.6.0_41) from 1.6.0_37, I went into Eclipse and updated the Installed JREs in the Java section under the preferences menu. I then went into my ANT script to test some changes I made and when I tried to run the ANT script I got this error:
Specified VM install not found: type Standard VM, name jdk1.6.0_37
The specified VM is not the jdk1.6.0_41. This has also been updated in the PATH and JAVA_HOME environment variables.
Any suggestions as to WHERE else to make a change so that ANT sees this?
Here is the error I'm getting:
Thanks.
1. Which version of Java is required to run Apache Ant? You will need Java installed on your system, version 1.8 or later required. The later the version of Java, the more Ant tasks you get.
Ant has task condition which sets a property if a certain condition holds true, we compare current Java version to 1.5/1.6, if false then fail the build. Example 2 to check version in Ant: We compare current Java version to 1.5/1.6 and set result back to property of condition, this property can be used later on.
Check your installation by opening a command line and typing ant -version into the commend line. The system should find the command ant and show the version number of your installed Ant version.
After additional hunting around in Eclipse, I found in the ANT view an External Configuration Tools option when right clicking my Ant script name and under the JRE tab is where the setting was. I changed the setting to use the same JRE as the workspace and then all was fine.
Just in case anyone else ran into this same problem I thought it might be helpful to post my findings.
Ant won't mind the new jdk version as long as its name stays unchanged under Preferences / Java / Installed JREs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With