This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The recommended way (if you can call it that) is to use JNDI. Unfortunately, you will also need to use a service provider that will connect to the windows registry. You will need to do a search on the Sun website to find a source.
If this "registry" is the active directory, then you could probably use the base JNDI libs, as active directory is compatible with LDAP.
Trying to use APIs to access the registry in windows makes your code non portable. If you are sure that your application will not be ported to other platforms, use a native library to read these values and use JNI to invoke this library.
Here is the native function that seems to be the one you want (I am not entirely sure).
Public Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" ( _ ByVal hKey As Long, _ ' Handle to open registry key ByVal lpValueName As String, _ ' Name of value ByVal lpReserved As Long, _ ' Reserved, must be 0 lpType As Long, _ ' Registry data type constant lpData As Any, _ ' By reference variable for data lpcbData As Long _ ' Number of bytes of data written ) As Long
You can use java's JNI to invoke functions that are native to that platform, using a language like C.