Is there a way for Eclipse to output all the Jars I would like to define on my ClassPath variable in the Manifest when exporting a project as a jar? I would like to be able to just click on all the jars I need my project to depend on, and then have Eclipse output it all like:
ClassPath: . /lib/somejar.jar /lib/otherjar.jar
Thanks
Yes, there is:
Eclipse > File > Export > Java > Runnable JAR File > "Copy required libraries into a sub-folder next to the generated JAR".
It will create a MANIFEST.MF with all the classpath entries of your Java project. You need to have a working launch configuration.
Do not use "Package required libraries", as it will create a nasty Jar-In-Jar-ResourceLoader class into your jar file. You usually don't want such things in there.
Btw, did you try Maven? It does that for you automatically. Every time. On all platforms. On all IDEs. Independently of your Eclipse version. It does that also on your build server when you're on holiday.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With