Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I've developed an Eclipse (3.5) plugin for my employer (a university) using Graphical Editing Framework (GEF).

Deploying the app should be as simple as pressing the "Export Wizard" link and entering an archive name and hitting "Finish" (shown in the images below).

But then I encounter the an error dialog protesting "Could not find one or more classes: "org.apache.tools.ant.launch.AntMain". Please check the Ant classpath."

But I've looked inside the Eclipse>Preferences>Ant>Runtime>ClassPath and found everything to be in order.

What's wrong? How do I set the class path so I can deploy my plugin.

UPDATE:

  • I'm using Mac OSX Leopard for development.
  • I also correct the ANT_HOME settings in preferences>Ant>Runtime>ClassPath to /Applications/eclipse/plugins/org.apache.ant_1.7.1.v20090120-1145 as others have suggested

The Export Wizard Link

The Export Wizard

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I tried for far too long to solve this problem, so I resorted to the good ol` truism, "Java hates OSX" and decided to try the whole process on Vista... and BAM! worked first time, no issues.

So, the answer to my question is "Don't use OSX, use Windows or Linux".

I'm not a jerk so I posted this platform bug in Eclipse bugzilla.

VonC was indeed awesome enough to give me really good advise and point to other bugs I couldn't find.. he deserves more votes..

share|improve this answer
    
Thank you for this feedback, I will check out that bug entry. –  VonC Sep 9 '09 at 15:00
    
Look, I'm developing plugins on OS X for a couple of years now. Never had this issue. Did you recently upgrade to Snow Leopard? –  zvikico Sep 9 '09 at 16:16
    
No, haven't upgraded to Snow Leopard. What can else can I say, I have the default Eclipse 3.5 install + GEF + PLatform SDK... i have no idea what went wrong –  CVertex Sep 9 '09 at 17:11

It does not seem to be related to eclipse 3.5 (it has been reported with eclipse3.2 or 3.1.2).

In one case, it was because the build was using:

 -Djava.endorsed.dirs

which happened to point on an old Ant version.

Another said its Ant->Runtime / "Ant Home" was erroneously set to the current project dir. setting it to /usr/share/ant makes ant work properly. (But you said that "eveything was in order" there).

A third had to manually add

/usr/lib/eclipse/plugins/org.apache.ant_1.6.5/lib/ant-launcher.jar

to the Ant classpath in the preferences to make it work.

It all boils dow to an older version of Ant being somehow referenced.

share|improve this answer
    
Thanks. I'm indeed using the latest 3.5, not an older version. And teh ANT version I'm using is pointing to the one included with eclipse itself. (inside eclipse/plugins). One additional thing I should mention is that I'm using Mac OSX –  CVertex Sep 9 '09 at 13:42
    
Also, I already set the ANT_HOME folder to the eclipse/plugin/org.apache.ant_1.7.1.v20090120-1145 and still see the same error –  CVertex Sep 9 '09 at 13:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.