简体   繁体   中英

Using Registry with JAVA in Mac OS

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

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.

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