Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个想要打包为 jar 文件的 Swing 应用程序。我还有一个存储用户设置属性的属性文件。
我可以将此文件存储在 jar 文件中,并且应用程序会自动写入 jar 文件吗?
我想避免有两个文件,jar 和它的外部属性。
你可以,但这并不意味着你应该。
相反,捆绑一个默认属性文件,但检查一组用户特定的属性。
您当然可以将属性文件捆绑jar在read-only. 因此,您将无法在其中写入任何内容。
jar
read-only