File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes How to access the windows registry Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to access the windows registry" Watch "How to access the windows registry" New topic

How to access the windows registry

Garry Kalra
Ranch Hand

Joined: May 25, 2001
Posts: 111
Can i access and make changes to the windows registry using java.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
As far as I know, you'll have to write some native code to access platform specific features.
But if you can write a dynamic library (dll) that accesses the Windows registry you can declare a native method in your Java code and access that method after loading the library with the System object.
Hope this helps

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Steve Deadsea
Ranch Hand

Joined: Dec 03, 2001
Posts: 125
This work of writing native code to access the windows registry has of course already been done by various parties.
Microsoft has libraries to do so in the package.
However you only get those with J++ and I have no idea if you can legally get them elsewhere and redistribute them or not.
There is a products called JNDI that looks like it can do it:
It also appears that the Java 1.4 preferences API can look into the Windows registry, here is an example:
I agree. Here's the link:
subject: How to access the windows registry
It's not a secret anymore!