Problems making an application - Eclipse, Ant, classpaths and classNotFound
in
Integration and Hardware
•
3 years ago
I use Eclipse for my main development but when I want an .app or .exe I usually paste my code into the Processing IDE and export the applications from there. I remove the java related stuff like the main function at the bottom and the package from the top and the class that extends PApplet.
This has worked fine until I found a new library that is a java library which is located in Library/Java/Extensions/ on my mac. When I try to make my application it hangs on Windows (Win7 btw) with the "ClassNotFound" (or similar) statement in the mini-dialog-window. (I think I solved that by faking the jars into being libraries, but still not too sure as to why they worked or if they have anything to do with classNotFound)
So I guess that there are several reasons as to why this might happen. One thing is missing Jars. Another is the package (mypackage.TheClass) thing and the java -classpath (no idea where I add that if needed in Eclipse for that matter). And then there is the actual making of the application. Perhaps I need to learn more on the compiling-part? The P5 Exporter isn't working unfortunately. I also was wondering about Ant. Do I need to learn Ant to figure out what the problem is? I guess everything is worthwhile to learn, but I am not sure of where to go on the reading.
And on top of that I copied a fully working Processing-class in Eclipse and just renamed it, changing the name at the top and the main class at the bottom. It usually works fine, but now I get this: Exception in thread "main" java.lang.NoClassDefFoundError:
So back to the compiling? Or where do I turn to learn relevant compiling-techniques?
It seems like at least two different sets of problems in the same post here but any comment would be helpful.
I use this statement for the Eclipse standalone class at the bottom:
static public void main(String args[]) {
PApplet.main(new String[] { packagename.NewClassCopiedFromWorkingOne.class.getName() });
}
Any hints or ideas where to read up would be helpful. Too much time spent on trying to work around this...
Do I mix in Java too much. But should that be a problem?
I want to solve this since I suspect it will show up alot.
All the best.
/JohanW
This has worked fine until I found a new library that is a java library which is located in Library/Java/Extensions/ on my mac. When I try to make my application it hangs on Windows (Win7 btw) with the "ClassNotFound" (or similar) statement in the mini-dialog-window. (I think I solved that by faking the jars into being libraries, but still not too sure as to why they worked or if they have anything to do with classNotFound)
So I guess that there are several reasons as to why this might happen. One thing is missing Jars. Another is the package (mypackage.TheClass) thing and the java -classpath (no idea where I add that if needed in Eclipse for that matter). And then there is the actual making of the application. Perhaps I need to learn more on the compiling-part? The P5 Exporter isn't working unfortunately. I also was wondering about Ant. Do I need to learn Ant to figure out what the problem is? I guess everything is worthwhile to learn, but I am not sure of where to go on the reading.
And on top of that I copied a fully working Processing-class in Eclipse and just renamed it, changing the name at the top and the main class at the bottom. It usually works fine, but now I get this: Exception in thread "main" java.lang.NoClassDefFoundError:
So back to the compiling? Or where do I turn to learn relevant compiling-techniques?
It seems like at least two different sets of problems in the same post here but any comment would be helpful.
I use this statement for the Eclipse standalone class at the bottom:
static public void main(String args[]) {
PApplet.main(new String[] { packagename.NewClassCopiedFromWorkingOne.class.getName() });
}
Any hints or ideas where to read up would be helpful. Too much time spent on trying to work around this...
Do I mix in Java too much. But should that be a problem?
I want to solve this since I suspect it will show up alot.
All the best.
/JohanW
1