Error running Ant build

I get the following error when I run: "Run as" -> "Ant build..." from the Eclipse Resource view:

"Could not find the main class org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"

I verified that I have remoteAnt.jar available.  This was working on another computer.  I installed Eclipse on a new computer and then copied my workspace from my old computer to my new computer.  Is there something else I need to set up to be able to run an Ant build?

The code below is the command line that is failing.
"C:\Program Files\Java\jdk1.6.0_24\jre\bin\javaw.exe" "-Dant.home=C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145" "-Dant.library.dir=C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib" "-Djava.library.path=C:\Program Files (x86)\eclipse;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre6/bin/client;C:/Program Files (x86)/Java/jre6/bin;C:\oracle\product\11.2.0\dbhome\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\eclipse\configuration\org.eclipse.osgi\bundles\869\1\.cp" -Dfile.encoding=UTF-8 "-Xbootclasspath:C:\Program Files (x86)\Java\jdk1.6.0\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.6.0\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.6.0\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.6.0\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.6.0\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.6.0\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.6.0\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.6.0\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.6.0\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.6.0\jre\lib\ext\sunpkcs11.jar" -classpath "C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-antlr.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-apache-bcel.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-apache-bsf.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-apache-log4j.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-apache-oro.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-apache-regexp.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-apache-resolver.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-commons-logging.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-commons-net.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-jai.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-javamail.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-jdepend.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-jmf.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-jsch.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-junit.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-launcher.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-netrexx.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-nodeps.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-starteam.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-stylebook.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-swing.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-trax.jar;C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib\ant-weblogic.jar;C:\Program Files (x86)\eclipse\configuration\org.eclipse.osgi\bundles\697\1\.cp\lib\remoteAnt.jar;C:\Program Files\Java\jdk1.6.0_24\lib\tools.jar;C:\Program Files (x86)\eclipse\plugins\org.eclipse.swt.win32.win32.x86_3.5.2.v3557f.jar" org.eclipse.ant.internal.ui.antsupport.InternalAntRunner -Dorg.eclipse.ant.core.ANT_PROCESS_ID=1300298295550 -Declipse.connect.port=51425 "-Declipse.pdebuild.home=/C:/Program Files (x86)/eclipse/plugins/org.eclipse.pde.build_3.5.2.R35x_20100114/./" "-Declipse.pdebuild.scripts=/C:/Program Files (x86)/eclipse/plugins/org.eclipse.pde.build_3.5.2.R35x_20100114/scripts/" "-Declipse.pdebuild.templates=/C:/Program Files (x86)/eclipse/plugins/org.eclipse.pde.build_3.5.2.R35x_20100114/templates/" "-Dant.home=C:\Program Files (x86)\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145" -logger org.eclipse.ant.internal.ui.antsupport.logger.RemoteAntBuildLogger -inputhandler org.eclipse.ant.internal.ui.antsupport.inputhandler.ProxyInputHandler -buildfile C:\Users\Owner\workspace\SOAPRequestHandler\build.xml war

Open in new window

david_m_jacobsonAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
You certainly don't want to be deleting directories. I would begin by reducing this complexity and uninstalling any javas you don't want
1
 
CEHJCommented:
>>I verified that I have remoteAnt.jar available

Is it in the following location?

C:\Program Files (x86)\eclipse\configuration\org.eclipse.osgi\bundles\697\1\.cp\lib\remoteAnt.jar
0
 
david_m_jacobsonAuthor Commented:
yes
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
david_m_jacobsonAuthor Commented:
I don't know if it's related but here are some more configuration issues:

I installed Maven.  Now when I start up Eclipse I get the following pop-up window:

"The Maven Integration Requires that Eclipse be running in a JDK, because a number of Maven core plugins are using jars from the JDK.

Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JREs are also using JDK installs."

I only have one Installed JRE defined in Eclipse:

C:\Java\jdk1.6.0_24

This is a 64-bit Windows Java install.  I got this from the Oracle website.  Note that I am running a 64-bit version of Windows 7.

I added the following lines to eclipse.ini:

-vm
C:\Java\jdk1.6.0_24\bin

Now when I start up Eclipse I get the following pop-up:

JVM terminated. Exit code=-1
-Xms1024m
-Xmx1024M
-XX:+UseParallelGC
-XX:PermSize=512M
-XX:MaxPermSize=512M
-Djava.class.path=C:\Program Files (x86)\eclipse\plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-os win32
-ws win32
-arch x86
-showsplash C:\Program Files (x86)\eclipse\\plugins\org.eclipse.platform_3.3.202.v201002111343\splash.bmp
-launcher C:\Program Files (x86)\eclipse\eclipse.exe
-name Eclipse
--launcher.library C:\Program Files (x86)\eclipse_1206.dll
-startup C:\Program Files (x86)\eclipse\plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-product org.eclipse.epp.package.jee.product
-vm C:\Java\jdk1.6.0_24\bin\..\jre\bin\server\jvm.dll
-vmargs
-Xms1024m
-Xms1024M
-XX:+UseParallelGC
-XX:PermSize=512M
-XX:MaxPermSize=512M
-Djava.class.path=C:\Program Files (x86)\eclipse\plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

When I click the OK button Eclipse does NOT start.  So I am NOT able to start Eclipse with the following setting in eclipse.ini:

-vm
C:\Java\jdk1.6.0_24\bin

It seems like my Eclipse environment does not think I have a JDK installed even though I have a JDK installed.
0
 
CEHJCommented:
Try setting env var JAVA_HOME to


C:\Java\jdk1.6.0_24
0
 
david_m_jacobsonAuthor Commented:
I already had that define.
0
 
objectsConnect With a Mentor Commented:
> -vm
> C:\Java\jdk1.6.0_24\bin

That should be:


-vm
C:\Java\jdk1.6.0_24\bin\javaw.exe
0
 
david_m_jacobsonAuthor Commented:
I change eclipse.ini to include:

-vm
C:\Java\jdk1.6.0_24\bin\javaw.exe

Now when I try to start Eclipse, Eclipse never opens.  I opened up the Task Manager and watched the processes while I clicked on the Eclipse icon to start.  I can see that the eclipse.exe process runs for about two seconds and then is removed from the list of processes.  I do not get any error message displayed.  The eclipse.exe process is removed from the list of processes and I do not get any other visible message.  Is there a log file that I could look in to see what is going on?  I am wondering whether this is a conflict between the 64-bit version of the Java JDK and Eclipse.  Note that I have Eclipse installed in C:\Program Files (x86)\eclipse.  Programs that are not 64-bit are installed in the C:\Program Files (x86) folder.
0
 
CEHJCommented:
Try changing it to

C:\Java\jdk1.6.0_24\bin\java.exe

and try again
0
 
david_m_jacobsonAuthor Commented:
I get a slightly different result but still no success.  Again, Eclipse does not start when I click on the Eclipse icon.  When I watch the processes in the Task Manager window I now see a conhost.exe process start for a couple seconds and then stop.  I also see a DOS command window open for a couple seconds and then close.  That's all that happens.

A couple notes...here is what I have in the command for my Eclipse icon:

"C:\Program Files (x86)\eclipse\eclipse.exe" -vmargs -Xms1024m -Xmx1024M -XX:+UseParallelGC -XX:PermSize=512M -XX:MaxPermSize=512M

Here is everything in my eclipse.ini:

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vm
C:\Java\jdk1.6.0_24\bin\java.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

I am running this on a Windows 7 64-bit professional version operating system.
0
 
CEHJCommented:
>>
A couple notes...here is what I have in the command for my Eclipse icon:

"C:\Program Files (x86)\eclipse\eclipse.exe" -vmargs -Xms1024m -Xmx1024M -XX:+UseParallelGC -XX:PermSize=512M -XX:MaxPermSize=512M
>>

It might be worth entering that command at the command line
0
 
david_m_jacobsonAuthor Commented:
I get the following error when I execute this command from the command line:

"Could not create the Java virtual machine."

The title in the dialog box is "Java Virtual Machine Launcher."
0
 
CEHJCommented:
As a  matter of fact, have you been able to compile and run a 64 bit java app?
0
 
david_m_jacobsonAuthor Commented:
No, this is a new computer that I am working on.  I was working on another Windows 7 64-bit computer.  I got the new computer, installed Eclipse, installed the Java JDK 64-bit Windows version, copied my workspace directory and all the sub-directories of the workspace directory from my old computer to my new computer and here I am.  I am not able to compile anything and now I am not able to start Eclipse.
0
 
CEHJCommented:
I think probably the problem ought to be divided into two parts:

1. Get 64 bit Java running
2. Get 64 bit Eclipse running
0
 
david_m_jacobsonAuthor Commented:
I just tested compiling a Java program.  I was able to manually compile a Java program from a DOS command window using the following command:

> javac [my_java_program.java]

This successfully created a .class file so it looks like I can manually compile a Java program.
0
 
david_m_jacobsonAuthor Commented:
How do I test getting 64 bit Java running?  I don't know what is not configured properly.
0
 
david_m_jacobsonAuthor Commented:
Note that I have several versions of Java installed on my computer.  I believe that other programs (e.g., Oracle) installed different versions of Java.  Here is what I have:

C:\Java\jdk1.6.0_24:
This is the 64-bit Java JDK that I want to use.

C:\Java\jre6:
I believe this was installed by the 64-bit Java JDK.

C:\Program Files (x86)\Java\jdk1.6.0:
I believe this is a 32-bit version of the Java JDK.  I don't want to use this.  Can I just delete this directory???

C:\Program Files (x86)\Java\jre1.6.0:
I'm not sure where I got this but some program just wanted the JRE installed.  Again, I don't think I need this.  Can I just delete this directory???

C:\Program Files (x86)\Java\jre6:
I think this was installed by the JDK.  Again, I don't think I need this.  Can I just delete this directory???

C:\Windows\System32\java.exe
I don't know if this came with Windows but the date and size of this file match the java.exe file in C:\Java\jdk1.6.0_24\bin

C:\Windows\System32\javaw.exe
I don't know if this came with Windows but the date and size of this file match the javaw.exe file in C:\Java\jdk1.6.0_24\bin

C:\Windows\System32\javaws.exe
I don't know if this came with Windows but the date and size of this file match the javaws.exe file in C:\Java\jdk1.6.0_24\bin
0
 
david_m_jacobsonAuthor Commented:
First, thank you for all your help.

Second, FYI, I am in the middle of uninstalling all the Java JDKs and JREs installed.  I uninstalled four or five programs and rebooted.  I am able to reinstall the JDK that I downloaded. The name of the JDK is:

Java(TM) SE Development Kit 6.0 Update 24

The name of the installer file I downloaded is called:

jdk-6u24-windows-x64.exe

Let's see what happens.  Again, thank you for your help.
0
 
david_m_jacobsonAuthor Commented:
Problem solved :-)

I uninstalled all the Java JDKs and JREs that I had on my computer.  I then downloaded the 32-bit Java JDK (even though I am running on a 64-bit Windows 7 platform).  I then installed the 32-bit Java JDK.  Now I am able to run the Ant build.

Thank you for your help!
0
 
CEHJCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.