How is it possible to read/write to the Windows registry using Java?
My previous edit to @David's answer was rejected. Here is some useful information about it.
This "magic" works because Sun implements the Preferences
class for Windows as part of JDK, but it is package private. Parts of the implementation use JNI.
java.util.prefs.WindowsPreferences
: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/prefs/WindowsPreferences.javaThe implementation is selected at runtime using a factory method here: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/prefs/Preferences.java#Preferences.0factory
The real question: Why doesn't OpenJDK expose this API to public?