简体   繁体   中英

Properties file (user settings) inside a jar file

I have a Swing application I want to package as a jar file. I also have a properties file that I store user set properties in.

Can I store this file inside the jar file and will the application automatically write into the jar file?

I want to avoid having two files, the jar and the properties external of it.

You could , but that doesn't mean you should .

Instead, bundle a default properties file, but check for a user-specific set of properties.

You can surely bundle properties file inside of jar , But one problem with that is, it will become kind of read-only . So you will not be able to write anything into it.

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