Solved

Error running Ant build

Posted on 2011-03-16
21
4,353 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:david_m_jacobson
  • 12
  • 8
21 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 35150718
>>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
 

Author Comment

by:david_m_jacobson
ID: 35151159
yes
0
 

Author Comment

by:david_m_jacobson
ID: 35151645
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 35151836
Try setting env var JAVA_HOME to


C:\Java\jdk1.6.0_24
0
 

Author Comment

by:david_m_jacobson
ID: 35152030
I already had that define.
0
 
LVL 92

Assisted Solution

by:objects
objects earned 20 total points
ID: 35152218
> -vm
> C:\Java\jdk1.6.0_24\bin

That should be:


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

Author Comment

by:david_m_jacobson
ID: 35155753
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 35155854
Try changing it to

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

and try again
0
 

Author Comment

by:david_m_jacobson
ID: 35155903
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 35155944
>>
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:david_m_jacobson
ID: 35155968
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 35155984
As a  matter of fact, have you been able to compile and run a 64 bit java app?
0
 

Author Comment

by:david_m_jacobson
ID: 35156021
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 35156046
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
 

Author Comment

by:david_m_jacobson
ID: 35156049
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
 

Author Comment

by:david_m_jacobson
ID: 35156061
How do I test getting 64 bit Java running?  I don't know what is not configured properly.
0
 

Author Comment

by:david_m_jacobson
ID: 35156131
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
 
LVL 86

Accepted Solution

by:
CEHJ earned 480 total points
ID: 35156157
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
 

Author Comment

by:david_m_jacobson
ID: 35156426
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
 

Author Comment

by:david_m_jacobson
ID: 35157138
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 35157623
:)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now