|Eclipse Juno and Ant 1.9 Trouble [message #1049757]
||Fri, 26 April 2013 04:28
| Ricky Weidner
Registered: April 2013
Hi there, |
I have a strange Problem in Eclipse Juno.
I created a very simple Java-Project, to learn building with ant.
- If I run it in Eclipse everything works fine.
- I build it with Ant and the resulting executable jar works fine.
- After the build I run it again with Eclipse - and it doesn't work any more!
I get the Message Quote:
Could not find the main class: main.Main. Program will exit. and the Console shows a Quote:
java.lang.NoClassDefFoundError: main/Main is thrown.
Then I edit the class test.Test, which is imported into the main.Main class und used in the main-Method of main.Main.
I do a simple whitespace-change (Add an empty line oder append a space after a line), save it, run it in Eclipse ...
... and it works fine!
I don't want necessarily a solution (although I'd appreceate that).
I'm asking humbly for suggestions where to grip this issue, because I'm out of ideas for now...
Thanks in advance!
|Re: Eclipse Juno and Ant 1.9 Trouble [message #1050005 is a reply to message #1049757]
||Fri, 26 April 2013 11:08
| Stephan Herrmann
Registered: July 2009
Do Eclipse and Ant use the same output folders?|
Perhaps the ant script, after building the jar, wipes the bin folder, without Eclipse telling about this?
Then when Eclipse tries to run the application, the .class files, it had created shortly before, are unexpectedly missing?
A good practice when mixing compiling in Eclipse and via Ant is to create a launch configuration that performs a refresh on the affected resources, in the simple case: the project. This gives Eclipse a chance to find that require files have been removed and automatically rebuild them.
Powered by FUDForum
. Page generated in 0.06711 seconds