Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse Juno and Ant 1.9 Trouble
Eclipse Juno and Ant 1.9 Trouble [message #1049757] Fri, 26 April 2013 08:28 Go to next message
Ricky Weidner is currently offline Ricky Weidner
Messages: 1
Registered: April 2013
Junior Member
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 15:08 Go to previous message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 1024
Registered: July 2009
Senior Member
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.

HTH,
Stephan
Previous Topic:Running the JDT tests
Next Topic: database code& console
Goto Forum:
  


Current Time: Sat Oct 25 16:45:06 GMT 2014

Powered by FUDForum. Page generated in 0.13286 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software