40

When I try and do an Ant build on my mac (Snow Leopard, Eclipse 3.6 - Helios) I get an error dialog that says

"Problem Occured"
'Launching projectName build.xml' has encountered a problem. Specified VM install not found: type Standard VM, name jdk1.5.0_14

I can't even find any preferences setting in Eclipse that specifies for it to use jdk1.5.0_14.

When I went into my preferences and went to the Java section and looked at the Installed JREs, the only one I have specified is 1.6.0. Where is it getting the setting to try and use 1.5? (Or am I barking up the wrong tree?)

cmcculloh
  • 47,596
  • 40
  • 105
  • 130

6 Answers6

78

Your ant project launcher refers for some reason to a Java 5 environment.

Select "Run as -> Configurations" and locate the ant build. Then indicate you want this configuration to run with a Java 6 JVM.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • 31
    To clarify this answer for Eclipse indigo: "Right click on an ANT TASK and select Run as -> External Tools Configuration". You'll probably see an 'X' by the JRE tab where the error exists. This answer helped me solve this problem as well. Thank you! – David Parks Jul 03 '11 at 05:38
  • Thanks, David. To continue, click on the JRE tab and (usually) click Run in the same JRE as the workspace. I think this was a problem because I upgraded to Indigo and didn't rebuild a new workspace, but just launched on the one I was already using. Or something. Anyway, easy fix thanks to this answer. – Russ Bateman Nov 15 '12 at 23:28
  • Now five years later, if a developer has a choice I would recommend using maven instead of ant, as the maven support in all IDE's are smart enough to handle this kind of problems. – Thorbjørn Ravn Andersen Jan 15 '16 at 15:32
8

Delete the ".metadata.plugins\org.eclipse.debug.core.launches\ build.xml.launch" file and problem is solved".

Koekiebox
  • 5,793
  • 14
  • 53
  • 88
  • Thanks I was facing a similar error message. Deleted that file, executed again my ant task and it worked like a charm.. – Bartzilla Sep 09 '12 at 17:54
  • Perfect. My location was in a slightly different place. I got the same error as above, I deleted my `/workspace/.metadata/.plugins/org.eclipse.debug.core/.launches/AgentUtilities build.xml.launch` file while eclipse was still running. When I ran my ant build again the error above did not show. – Eric Leschinski Oct 27 '12 at 15:26
  • Thanks much for the fix! My juno install started doing this, one day it worked the next it didn't. One thing I noticed is that when I would right-click on the build.xml file and select 'Run As' the only option on there was 'Run configurations'. After deleting the appropriate build.xml.launch file it all works normally, right click gives me the two options to run as an ant task as well as run on server and run a testNG test suite. – Dan Haynes Nov 10 '12 at 23:32
  • I was facing the same issue. It got resolved after I deleted the file. Thanks very much. – sshah May 23 '13 at 19:14
3

This is just an update of the previously posted solution for later versions of Eclipse, like STS.

  1. If your Ant View is open, R-click on the root (otherwise Run -> External Tools -> External Tools Configuraitons)
  2. Run as -> External Tools Configurations ...
  3. Your Ant launch should be selected in the External Tools launchers, if not selected manually
  4. Go to the JRE tab
  5. Select Run in the same JRE as the workspace - you can also select a different JRE using the buttons on the right.
  6. Re-run your ant task(s) - this time you will not get the error message.
George
  • 31
  • 1
0

I kept getting "Specified VM install not found: type MacOS X VM, name Java SE 6...". And i did this accidentally and it worked: Properties-Java Compiler-Installed JREs-Search Button. It did some soul searching,created yet another JRE entry and it all worked!

0

There was a whole bunch of stuff I had wrong that I changed to fix this, but I believe the crucial piece was an %ATG_HOME%/home/localconfig/dasENV.sh file had an ATGJRE a path that was incorrect.

cmcculloh
  • 47,596
  • 40
  • 105
  • 130
-1

Right click on the project and choose properties. Go to Java Compiler and make sure Compiler compliance level is set to 1.6 rather than 1.5. I think that should do the trick.