Build java projects with ant
I need help to build java projects with ant.
This java projects where created with netbeans. If I build them using netbeans everything works fine... Building via ant commands works, but then my application fails to start: "Exception in thread "main" java.lang.NoClassDefFoundError".
I already realized (I think) that it is main-class and class-path problems.
I made two experiences and compare the results:
1 - build with netbeans and then distribute
2 - build and distribute by ant command
At my final folder I got:
1 - MyProject/jars with MyProject.jar and every projects and libraries dependencies
2 - MyProject/ with every projects dependencies (but no libraries dependencies) and jars folder with only MyProject.jar
I unpacked both MyProject.jar files and manifest content was:
1 - it includes class-path (with all dependencies) and main-class
2 - it includes main-class but no class-path
I already follow up a lot of suggestions but with no result. Maybe it's me that is doing something wrong. But I am completely lost on this so I would appreciate some help.
What I am looking for, and I don't know if that is possible, is for some command line solution via ant parameters or something. Because MyProject is not that simple, it has a lot of other project dependencies, and change build.xml (or others) for all of them it would be slow...
Thanks in advance.