I recently upgraded to Eclipse Kepler, and am having issues with Ant. I am getting the Java Virtual Machine Launcher - A Java Exception has occurred error no matter which target I choose in my build files.
I tried reinstalling my JDK, and I still get the error. I am running the 7u25 version of the JDK. I have my JAVA_HOME environment variable set to C:\Progra~1\Java\jdk1.7.0_25
, so I don't think this is the problem. What else could be causing the problem?
EDIT: I also tested ant in the command line and it works just fine. Is this a bug in Kepler?
EDIT 2: Here is the log of the errors:
org.eclipse.core.runtime.CoreException: Could not find one or more classes: "org.apache.tools.ant.BuildLogger". Please check the Ant classpath.
at org.eclipse.ant.core.AntRunner.problemLoadingClass(AntRunner.java:467)
at org.eclipse.ant.core.AntRunner.run(AntRunner.java:380)
at org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate.runInSameVM(AntLaunchDelegate.java:307)
at org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate.launch(AntLaunchDelegate.java:260)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:700)
at org.eclipse.core.externaltools.internal.model.ExternalToolBuilder.launchBuild(ExternalToolBuilder.java:181)
at org.eclipse.core.externaltools.internal.model.ExternalToolBuilder.doBuildBasedOnScope(ExternalToolBuilder.java:169)
at org.eclipse.core.externaltools.internal.model.ExternalToolBuilder.build(ExternalToolBuilder.java:88)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:514)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:423)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:830)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1018)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1222)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildLogger
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.eclipse.ant.core.AntRunner.run(AntRunner.java:324)
... 24 more
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.BuildLogger
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.eclipse.ant.internal.core.AntClassLoader.findClass(AntClassLoader.java:54)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 29 more
For me the problem were the JDK I were trying to use. The project I wanted to build was setup to use the 1.6 JDK. I got the same error as the questioner, but when I changed to Java 8 the build worked fine. So I am assuming that the ANT version that comes with newer versions Eclipse does not work with older JDKs.
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