简体   繁体   中英

Writing A Text File To A Jar

I'm writing a program which 'builds' another. I plan to save the settings insite the generated jar file, but am having some trouble with writing to an external jar. Any help is appreciated.

A jar is just a zip file so all you have to do is zip up your files and name the zip with a .jar extension.

One handy library to create jar archives is Shrinkwrap which allows you to put classes, resources, etc into jar files using a Java API

A better solution would be to create a second jar, and write your own ClassLoader to load classes from that jar. A kind of plugin mechanism.

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