kamikaze_pilot
kamikaze_pilot

Reputation: 14844

how do I add classpath to the exported runnable java .jar file using eclipse

so my projects have a lot of classpath variables set in the run configuration -> classpath tab in eclipse...

but once I exported the project as a runnable java jar file, none of these classpaths are exported to the jar's manifest file despite having specified this run configuration during the export dialogue....

how do I get eclipse to add these classpath variables to the exported jar's manifest?

besides doing everything manually of course...

Upvotes: 0

Views: 7634

Answers (3)

Dennis
Dennis

Reputation: 4017

Check out this post - i believe it answers your question.

Java: export to an .jar file in eclipse

Upvotes: 0

Nivas
Nivas

Reputation: 18364

You can create your own manifest file and ask eclipse to use it in the "Export->Jar" wizard.

You can also try "Export -> Runnable Jar" in the latest versions of eclipse. I have not tried it, this generally is supposed to include the referenced libraries, so it might include the classpath variables as well.

Upvotes: 1

Josh
Josh

Reputation: 36

Eclipse doesn't seem to have an option for creating a manifest, I think the export option is for library files rather than runnable jars. If I remember correctly you have to manually sign+add a manifest to a jar at once? Not sure though. But you would have to manually sign it anyway so not a massive deal.

Upvotes: 0

Related Questions