Reputation: 21
I am currently creating a spring app. Previously, I had been able to do ANT builds in eclipse but now I am not able to. When I now try to do ANT build, it says [JRE]: Unable to resolve JRE: jdk7 (Standard VM).
It will not allow me to run the ANT build. I restarted eclipse as well as my computer but nothing works.
I tried seeing if changing between the jre7 and jdk1.7 in the installed jre's but that did not do anything.
I think it has to with me uninstalling all the Java updates I had on my computer and installing the new jdk. It started happening after I did that.
Upvotes: 2
Views: 10586
Reputation: 1
The possible reason for this error is that no JRE is configured for ant configuration. Select build.xml and go to run->External tool confoguration of ant. In the configuration window navigate to jre tab and select the appropriate jre from the available option.
Upvotes: 0
Reputation: 711
First, make sure that your javac.exe is in the path. Oracle did an install of a new JRE and put C:\ProgramData\Oracle\Java\javapath at the front of my path. I got this error even though I had not changed the JRE under the JDK I was using.
After checking the Installed JRE and then verifying my path pointed first to the JDK bin folder, I then checked the JRE tab of the ant file launch config. The tab had an error indicator icon. I had specified "Separate JRE" in the "Runtime JRE" section. I clicked "Run in the same JRE as the workspace", then back on "Separate JRE", then selected the same JRE by browsing "Installed JREs..." and the error went away.
Upvotes: 1
Reputation: 12424
Try going to Eclipse's Window -> Preferences -> Java -> Compiler
Check out the Java version you're using.
Then go to Window -> Preferences -> Java -> Installed JREs
There choose the JRE that fits your Java version. (for example Java 1.7 fits JRE 7).
Upvotes: 1