Using Registry with JAVA in Mac OS

扶醉桌前 提交于 2019-12-08 02:05:55

问题


I have written a Java desktop application in Windows platform that is using the Windows Registry to save the application information like location of the application, time-period (like free-trial up to 30 days ) etc.

Now, i want to create the same java application to run on Mac OS. Although the most of the java code will be same but i am not sure about the Registry concept in Mac OS. Is there any Registry in Mac Os like in Windows platform. If yes, how can i use the Mac Registry with JAVA to write application information?

Regards,

Arun Kumar


回答1:


The java.util.prefs mechanism is the cross-platform way to approach this sort of thing. On Windows it's backed by the registry, on Mac it's backed by .plist files in ~/Library, and on Linux and friends it's backed by files in ~/.java, but the API you use to access the information is the same on all platforms.



来源:https://stackoverflow.com/questions/12478075/using-registry-with-java-in-mac-os

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!