简体   繁体   中英

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...

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.

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.

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

Java: export to an.jar file in eclipse

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM