Bug 101224 - ANT classpath does not use Eclipse installation's ANT after upgrade
Summary: ANT classpath does not use Eclipse installation's ANT after upgrade
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: readme
: 101150 170127 201418 318157 351744 (view as bug list)
Depends on: 366711
Blocks:
  Show dependency tree
 
Reported: 2005-06-22 06:28 EDT by MH CLA
Modified: 2012-01-12 06:09 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MH CLA 2005-06-22 06:28:01 EDT
I just upgraded from 3.1M6 to 3.1.RC3 and again my ANT targets don't work 
anymore:

!ENTRY org.eclipse.ant.core 4 1 2005-06-22 12:26:05.218
!MESSAGE Could not find one or more 
classes: "org.apache.tools.ant.BuildException". Please check the Ant classpath.
!STACK 0
java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
	at java.lang.Class.getConstructor0(Class.java:2640)
	at java.lang.Class.newInstance0(Class.java:321)
	at java.lang.Class.newInstance(Class.java:303)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:303)
	at 
org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate.runInSameVM
(AntLaunchDelegate.java:234)
	at 
org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate.launch
(AntLaunchDelegate.java:196)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch
(LaunchConfiguration.java:590)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch
(LaunchConfiguration.java:515)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch
(LaunchConfiguration.java:152)
	at 
org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.launchBuild
(ExternalToolBuilder.java:176)
	at 
org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.doBuildBasedOnSc
ope(ExternalToolBuilder.java:164)
	at org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.build
(ExternalToolBuilder.java:83)
	at org.eclipse.core.internal.events.BuildManager$2.run
(BuildManager.java:593)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:168)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:202)
	at org.eclipse.core.internal.events.BuildManager$1.run
(BuildManager.java:231)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:234)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop
(BuildManager.java:253)
	at org.eclipse.core.internal.events.BuildManager.build
(BuildManager.java:282)
	at org.eclipse.core.internal.resources.Workspace.build
(Workspace.java:211)
	at org.eclipse.ui.actions.GlobalBuildAction$1.run
(GlobalBuildAction.java:182)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)

!ENTRY org.eclipse.ant.core 4 1 2005-06-22 12:27:58.468
!MESSAGE Could not find one or more 
classes: "org.apache.tools.ant.BuildException". Please check the Ant classpath.
!STACK 0
java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
	at java.lang.Class.getConstructor0(Class.java:2640)
	at java.lang.Class.newInstance0(Class.java:321)
	at java.lang.Class.newInstance(Class.java:303)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:303)
	at 
org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run
(AntLaunchDelegate.java:215)
	at java.lang.Thread.run(Thread.java:595)
Comment 1 MH CLA 2005-06-22 06:37:34 EDT
I noticed that

Preferences > Ant > Runtime > Classpath > Ant Home Entries (Default)

still hat the old ANT version number and not the included "1.6.5" version. So I 
had to manually change this Ant Home Entries to point to the 
included "C:/Programme/eclipse/plugins/org.apache.ant_1.6.5/lib/..." JARs. This 
is annoying and obsolete as we want to use the included ANT version of course - 
at least this should be the default. It makes no sense to install a new Eclipse 
version (with possible new ANT version) and the "Ant Home ENtries (Default)" 
point to a location that is invalid (because the old eclipse directory was 
renamed (e.g. "eclipse_old") but the new Eclipse ANT libs point 
to ".../eclipse/.../<old_version>/...". 
Comment 2 Darin Swanson CLA 2005-06-22 09:57:49 EDT
Investigate post 3.1 if we can improve the migration when the Ant plugin 
version changes.
Comment 3 Darin Swanson CLA 2005-06-22 10:17:20 EDT
*** Bug 101150 has been marked as a duplicate of this bug. ***
Comment 4 MH CLA 2007-08-28 11:39:46 EDT
The same happened when upgrading from Eclipse 3.2 to Eclipse 3.3 ... :-( ... I still had to manually change the classpath of ANT to the new Eclipse 3.3 files.
Comment 5 Darin Swanson CLA 2007-12-20 11:59:45 EST
*** Bug 201418 has been marked as a duplicate of this bug. ***
Comment 6 MH CLA 2009-06-24 11:07:09 EDT
Still the same bug in Eclipse 3.5 Galileo: my ANT tasks all didn't work anymore (Eclipse just started the target and never returned. I had (again) to replace all references to ANT 1.7.0 to Galileo's ANT 1.7.1 paths to get it working back again.

The .log file contained:

!ENTRY org.eclipse.ant.ui 4 120 2009-06-24 17:01:11.961
!MESSAGE Error logged from Ant UI: 
!STACK 0
java.net.SocketTimeoutException: Accept timed out
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
	at java.net.ServerSocket.implAccept(ServerSocket.java:453)
	at java.net.ServerSocket.accept(ServerSocket.java:421)
	at org.eclipse.ant.internal.ui.launchConfigurations.RemoteAntBuildListener$ServerConnection.run(RemoteAntBuildListener.java:95)
Comment 7 Michael Rennie CLA 2010-08-25 11:28:30 EDT
*** Bug 318157 has been marked as a duplicate of this bug. ***
Comment 8 Michael Rennie CLA 2010-08-25 11:34:19 EDT
*** Bug 170127 has been marked as a duplicate of this bug. ***
Comment 9 MH CLA 2011-02-21 04:18:47 EST
Still the same issue with Eclipse Helios (Version 3.6.2, Build id: M20110202-0800). All paths to the Eclipse ANT JARs point to the old files. => Once again, had to remove all entries and manually add the paths of Eclipse Helios ANT JARs ...
Comment 10 Michael Rennie CLA 2011-02-22 10:15:36 EST
(In reply to comment #9)
> Still the same issue with Eclipse Helios (Version 3.6.2, Build id:
> M20110202-0800). All paths to the Eclipse ANT JARs point to the old files. =>
> Once again, had to remove all entries and manually add the paths of Eclipse
> Helios ANT JARs ...

I am wondering if this is a dupe of bug 325125. MH, what other plugins (if any) do you have installed? i.e. are you using a vanilla Eclipse platform, or do you have other software installed in it?
Comment 11 MH CLA 2011-02-23 14:57:07 EST
Plain vanilla (Java Developer Version) - but I always try to apply the automatic updates. I install every major Eclipse version separately. I also created a completely new workspace (after years of using the same).
Comment 12 Michael Rennie CLA 2011-02-23 15:57:02 EST
(In reply to comment #11)
> Plain vanilla (Java Developer Version) - but I always try to apply the
> automatic updates. I install every major Eclipse version separately. I also
> created a completely new workspace (after years of using the same).

Out of curiosity, have you tried pressing the 'Restore Defaults' button on the Runtime preference page? It will completely reset the default Ant home locations to be that of the version of Ant shipped with your Eclipse installation.
Comment 13 Michael Rennie CLA 2011-02-23 16:07:00 EST
Also out of curiosity do you have the following preference file in your workspace:

<path to your workspace>.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ant.core.prefs

with an 'ant_home' entry in it?

I am thinking that maybe along the way you have manually changed the Ant home location, which will then always be reused and not auto-update to the latest version that comes with Eclipse. If however you use the 'Restore Defaults' button on the Runtime pref page, these settings will be erased, and as mentioned you will always get the latest version of Ant in your default Ant home.
Comment 14 MH CLA 2011-02-25 06:53:49 EST
(In reply to comment #12)
> (In reply to comment #11)
> > Plain vanilla (Java Developer Version) - but I always try to apply the
> > automatic updates. I install every major Eclipse version separately. I also
> > created a completely new workspace (after years of using the same).
> 
> Out of curiosity, have you tried pressing the 'Restore Defaults' button on the
> Runtime preference page? It will completely reset the default Ant home
> locations to be that of the version of Ant shipped with your Eclipse
> installation.

Nope, never seen this. I just clicked on it and now lots of entries in "Ant Home ENtries (Default)" were generated! So next time, I will try to click this button.
Comment 15 MH CLA 2011-02-25 06:55:54 EST
(In reply to comment #13)
> Also out of curiosity do you have the following preference file in your
> workspace:
> 
> <path to your
> workspace>.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ant.core.prefs
> 
> with an 'ant_home' entry in it?
> 
> I am thinking that maybe along the way you have manually changed the Ant home
> location, which will then always be reused and not auto-update to the latest
> version that comes with Eclipse. If however you use the 'Restore Defaults'
> button on the Runtime pref page, these settings will be erased, and as
> mentioned you will always get the latest version of Ant in your default Ant
> home.

Nope, I just have org.eclipse.ant.ui.prefs and no other org.eclipse.ant.* files in this directory. (At least after pressing "Restore Defaults" after the post above.) So I hope, the next major Eclipse update will work as expected concerning integrated ANT.
Comment 16 Michael Rennie CLA 2011-02-25 09:51:30 EST
(In reply to comment #15)
> So next time, I will try to click this button.

Provided you do not manually edit the default Ant home entries, you *should* never have to press it again.

> Nope, I just have org.eclipse.ant.ui.prefs and no other org.eclipse.ant.* files
> in this directory. (At least after pressing "Restore Defaults" after the post
> above.)

That is what we want to see, restoring the defaults for the page removes the custom preferences that would have been saved in the o.e.ant.core.prefs file.

> So I hope, the next major Eclipse update will work as expected
> concerning integrated ANT.

So do I :)
Comment 17 Michael Rennie CLA 2011-06-06 16:59:50 EDT
Closing this as worksforme, MH if the problem comes back after your next Eclipse upgrade please reopen.
Comment 18 Michael Rennie CLA 2011-12-14 10:17:58 EST
*** Bug 351744 has been marked as a duplicate of this bug. ***
Comment 19 Ortwin Glück CLA 2012-01-12 05:15:42 EST
Happened to me again when upgrading from Helios to Indigo. Should be reopened (I can't do that).
Comment 20 Satyam Kandula CLA 2012-01-12 06:09:31 EST
(In reply to comment #19)
> Happened to me again when upgrading from Helios to Indigo. Should be reopened
> (I can't do that).
A new bug 366711 has been filed to track this. So, a reopen is not necessary!