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 add key to 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 add key to windows registry??" Watch "How to add key to windows registry??" New topic

How to add key to windows registry??

Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 135

I want to read or write registry key to windows registry using a java programme.
registry key is like "HKEY_LOCAL_MACHINE\SOFTWARE\KasperskyLab\protected\AVP12" // this registry key is a SAMPLE
How to do it?


Are you better than me? Then please show me my mistakes..
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
The links to the solution.
Greg Charles

Joined: Oct 01, 2001
Posts: 2968

I've never used it myself, but I believe the Java API class java.util.prefs.Preferences uses the Windows registry as its store when running on Windows. Its abilities to read and write registry keys would be limited, but depending on your requirements might be enough. If you need more flexibility, then you'll need to write (or find to download) a JNI interface for this job. Here another thread that might point you in the right direction:
I agree. Here's the link:
subject: How to add key to windows registry??
jQuery in Action, 3rd edition