简体   繁体   中英

Using Eclipse “export as Runnable Jar” without configurations

There should be something wrong in the way I'm using Eclipse, so let me explain: I have a folder in the project marked as src, in order to have my configuration being deployed correctly in the classpath when Eclipse compile my project. This works fine since in debugging/running from the IDE works just fine. But if I export the project as a runnable jar file, the config files are embedded in it, and as a result I can't allow the user change the configuration ( I have to remove manually the file from the jar, and put in the current dir in order to achieve the desired behavior). Is there some solution to have this automatic? I did something like this: exported the "Export as a runnable JAR" as an ANT file, then manually modified it to work as I want, but unfortunatelly I have to manually update the file when class path changes. Any suggestion?

In eclipse when you choose export option, you'll see JAR file, Javadoc and Runnable JAR file. Can you try JAR file option, where you can select/deselect the classpath along with the project? It also has an option to select only the class files without resources. Hope that option will be useful.

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