Developers, Developers, Developers! Maksim Sorokin IT Blog

24Aug/10Off

Working with Windows Registry in Java

There are commercial and free libraries which enable a possibility to work with Windows registry from Java. For example, there is nice, simple, free, but old jRegistryKey library. The problem is that it is gpl and works with additional dll file. It is under LGPL.

However, we can read and write to Windows Registry without additional libraries and any sort of JNI. First, check out this:
http://dmi.ensica.fr/doc/Java/j2sdk-1_4_2-doc/docs/j2h/java/util/prefs/WindowsPreferences.java.html
And here are some examples how guys work with that:
http://www.davidc.net/programming/java/reading-windows-registry-java-without-jni
http://www.jroller.com/lenkite/entry/use_pure_java_to_access
A bit hacky and works only with REG_SZ. But often that is enough!

Tagged as: , Comments Off
Comments (0) Trackbacks (1)

Leave a comment