简体   繁体   English

在Mac OS中将注册表与JAVA结合使用

[英]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. 我已经在Windows平台上编写了一个Java桌面应用程序,该应用程序使用Windows注册表来保存应用程序信息,例如应用程序的位置,时间段(例如30天免费试用)等。

Now, i want to create the same java application to run on Mac OS . 现在,我想创建相同的Java应用程序以在Mac OS运行 Although the most of the java code will be same but i am not sure about the Registry concept in Mac OS. 尽管大多数Java代码都是相同的,但我不确定Mac OS中的注册表概念。 Is there any Registry in Mac Os like in Windows platform. 像Windows平台一样, Mac OS中是否有任何注册表 If yes, how can i use the Mac Registry with JAVA to write application information? 如果是,我如何将Mac Registry与JAVA结合使用来编写应用程序信息?

Regards, 问候,

Arun Kumar 阿伦·库玛(Arun Kumar)

The java.util.prefs mechanism is the cross-platform way to approach this sort of thing. java.util.prefs机制是处理此类问题的跨平台方式。 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. 在Windows上,它由注册表支持,在Mac上,它由~/Library.plist文件支持,在Linux和朋友上,它由~/.java的文件支持,但是用于访问信息的API在所有方面都是相同的平台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM