I've a java project that use some external jar library, when i export my project with eclipse (File-Export-Runnable Jar File), i select the option for "co开发者_StackOverflow社区py external libraries into a subfolder next to the main jar" and eclipse automatically create for me a folder named :
myjarname_lib
I want to export the library in a folder named only lib , is it possible ? I've tried to rename the folder in lib but don't work, because the executable jar don't recognize the library in that folder. How can i change the name of the external lib ?
Here is a workaround: When you run the Export wizard, there is a checkbox to create an Ant buildfile. Choose a location for the buildfile inside your project somewhere, then finish the export. Open the buildfile that was created (you might need to hit "F5" to refresh the project). Then just replace all "myprojectname_lib" with "lib". From then on, use "Run As -> Ant Build" for your exports instead of the Eclipse built-in.
The drawbacks are that this buildfile is completely independent of your project and it seems to manage copying each dependency individually. If you change the dependencies of your project, you will have to manually update this file to get the correct exports.
精彩评论