Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ANT script error after installing newer version of JDK on my system

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:

enter image description here

Thanks.

like image 246
Melinda Avatar asked Feb 21 '13 20:02

Melinda


People also ask

Which version of Java does ant use?

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.

How does ant detect Java version?

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.

How do I check ant version?

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.


2 Answers

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.

like image 189
Melinda Avatar answered Sep 18 '22 18:09

Melinda


Ant won't mind the new jdk version as long as its name stays unchanged under Preferences / Java / Installed JREs.

like image 45
Chei Avatar answered Sep 21 '22 18:09

Chei