Eclipse export ja export and lib folder

I have a java project that uses some external jar library, when I export my project using eclipse (File-Export-Runnable Jar File), I choose the option to "copy external libraries to a subfolder next to the main jar" and eclipse will automatically create for me a folder with the name:

myjarname_lib 

I want to export the library to a folder named lib, is this possible? I tried to rename the folder to lib, but it does not work, because the executable jar does not recognize the library in this folder. How can I change the name of an external library?

+4
source share
1 answer

Here is a workaround: when starting the export wizard, there is a check box to create the Ant build file. Choose a location for the build file inside your project somewhere, then complete the export. Open the created buildfile (you may need to press "F5" to update the project). Then just replace all "myprojectname_lib" with "lib". From now on, use "Run As → Ant Build" for your export instead of the built-in Eclipse.

The disadvantages are that this build file is completely independent of your project and seems to control copying each dependency separately. If you change the dependencies of your project, you will have to manually update this file in order to get the correct export.

+8
source

All Articles