Eclipse/ant config problem

I've followed the tutorial for setting up eclipse to compile jme (very easy to follow) - but when I get to the step to actually build it from the build.xml file it does not work properly.  I right click and go to 2 ant build, and it returns the error "No targets could be determined for the buildfile".  The error log shows this:



Message: Internal error occurred retrieving targets



Exception Stack Trace: java.lang.NoClassDefFoundError: org/apache/tools/ant/Main

at org.apache.tools.ant.Project.initProperties(Project.java:308)

at org.apache.tools.ant.Project.init(Project.java:295)

at org.eclipse.ant.internal.ui.model.AntModelProject.init(AntModelProject.java:105)

at org.eclipse.ant.internal.ui.model.AntModel.initializeProject(AntModel.java:367)

at org.eclipse.ant.internal.ui.model.AntModel.prepareForFullParse(AntModel.java:341)

at org.eclipse.ant.internal.ui.model.AntModel.parseDocument(AntModel.java:305)

at org.eclipse.ant.internal.ui.model.AntModel.reconcile(AntModel.java:263)

at org.eclipse.ant.internal.ui.model.AntModel.getProjectNode(AntModel.java:1383)

at org.eclipse.ant.internal.ui.model.AntModel.getProjectNode(AntModel.java:1393)

at org.eclipse.ant.internal.ui.AntUtil.getTargets(AntUtil.java:236)

at org.eclipse.ant.internal.ui.launchConfigurations.AntTargetsTab$7.run(AntTargetsTab.java:493)

at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:369)

at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:313)

at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:763)

at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)

at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:760)

at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2283)

at org.eclipse.ui.internal.progress.ProgressManager$4.run(ProgressManager.java:1130)

at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)

at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1126)

at org.eclipse.ant.internal.ui.launchConfigurations.AntTargetsTab.getTargets(AntTargetsTab.java:510)

at org.eclipse.ant.internal.ui.launchConfigurations.AntTargetsTab.initializeFrom(AntTargetsTab.java:619)

at org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup.initializeFrom(AbstractLaunchConfigurationTabGroup.java:86)

at org.eclipse.ant.internal.ui.launchConfigurations.AntTabGroup.initializeFrom(AntTabGroup.java:46)

at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.displayInstanceTabs(LaunchConfigurationTabGroupViewer.java:655)

at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer$6.run(LaunchConfigurationTabGroupViewer.java:548)

at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)

at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.inputChanged(LaunchConfigurationTabGroupViewer.java:565)

at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput(LaunchConfigurationTabGroupViewer.java:529)

at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog.initializeContent(LaunchConfigurationPropertiesDialog.java:77)

at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.createContents(LaunchConfigurationsDialog.java:434)

at org.eclipse.jface.window.Window.create(Window.java:426)

at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1124)

at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.create(LaunchConfigurationsDialog.java:363)

at org.eclipse.jface.window.Window.open(Window.java:785)

at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1086)

at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog.open(LaunchConfigurationPropertiesDialog.java:180)

at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialog(DebugUITools.java:456)

at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchShortcut.launch(AntLaunchShortcut.java:337)

at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchShortcut.launch(AntLaunchShortcut.java:232)

at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchShortcut.launch(AntLaunchShortcut.java:177)

at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchShortcut.launch(AntLaunchShortcut.java:85)

at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:369)

at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:68)

at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)

at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)

at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)

at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3180)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2856)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)

at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)

at org.eclipse.core.launcher.Main.basicRun(Main.java:280)

at org.eclipse.core.launcher.Main.run(Main.java:977)

at org.eclipse.core.launcher.Main.main(Main.java:952)





Now I suspect that means that eclipse is not meshing with ant properly, but since I usually don't use eclipse I am not sure what the problem would be - if anyone can shed some light on the issue I would be grateful.



I read some of the other topics, and tried using the method of dragging the buildfile to the ant pane instead of right clicking.  That resulted in a "Problems occurred when invoking code from plug-in: "org.eclipse.jface"." message, with a similar trace to the first one.



Here is my eclipse version info, if it matters:

Eclipse SDK

Version: 3.2.2

Build id: M20070212-1330 ('Ubuntu' version: 3.2.2-3ubuntu3)



Both eclipse and ant were installed and configured by apt, I did not make any changes to them.  Last but not least -  the teapot demo works properly, so eclipse seems integrated with java fine.  ant also runs the build if I navigate to the directory with the buildfile and issue an 'ant' in the terminal:



"BUILD SUCCESSFUL

Total time: 29 seconds"

It seems like it does not find that class org/apache/tools/ant/Main, the needed package is not in the classpath!?!?!

Turns out they made the ant package wrong or something.  I extracted the ant-launcher files, copied them into the launch folder in ant.jar and rezipped it, then put it back where it should be - that fixed the problems.  I am not sure if this issue is unique to ubuntu, but the problem was in the default install of eclipse/ant directly from the repository.

I think it is bug of the package for Ubuntu. I have version 3.3.1.1 of Eclipse for Mac. Though, in the latest two years I have used several versions of Eclipse also under Slackware and Gentoo. And I have almost surelly used also Eclipse 3.2.2, because I update regularly. Though I never used distribution packages. I always downloaded it directly from Eclipse home page. I do not understand why to use a distribution package of an application that is already perfectly packaged as it is. Though, this is my personal consideration. Apart this I do not trust package maintainers of some Linux distributions. Recently, about september I got a broken Gentoo after a simple full update from repository because they decided to break support for some packages. Weird Tales!