简体   繁体   中英

exporting and running a jar

I wish to export a rather big jar - which has many dependencies from eclipse. I should also mention that my classpath differs from my buildpath, and on export I would like the classpath files to be exported as well as exporting it with the proper "Running configuration".

So may questions: 1. How can I export the classpath jars with my jar? Should I replace the builfpath entries with the classpath's? 2. Any quick way to get this done? 3. When I run the resulting jar - should I just run it "java -jar myJar.jar"? Or do I need to specify a "-classpath ..." as well to reference it to the other jars? (Note: on eclipse I am using - the export all jars option + I choose the runtime configuration and at the end result I can see a manifest file containg information).

Help would be greatly appreciated.

You export as a Runnable Jar in Eclipse. and then run as

java - jar <filename>.jar

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