Reputation: 3819
I know how to export a Java Project as a .jar including also .java source code (just export it as a plain .jar), and how how to export it as a runnable .jar including only .class files (just select the runnable .jar export style). If the project doesn't have dependecies on external libraries, I noticed that both .jar run correctly by command line.
Problem: if the project contains dependecies on some external library added in the Build Path, it results that the .jar exported as runnable correctly works while a plain .jar doesn't because the external libraries are not anymore found when launching from command line.
Annotation: external libraries are added as .jar in a folder "lib" in the project and from there added to the Build Path.
I want to be able to export the Java project while either including the .java source code and preserving the dependencies on external libraries so that it will run when launching it by command line. Any suggestion? All that I can find out is "just export it as runnable .jar", but this will hide the .java source codes.
EDIT: Can anyone explain why this happens?
Upvotes: 2
Views: 1455
Reputation: 36
If you don't need an automated way you can achieve it with following manual steps:
Upvotes: 1