Editing the Windows Registry with Java

M

Matthew Zimmer

Hey all,
I'm working on a program that I would like to have edit the Windows
registry. I found an open-tool called jst that is great for reading
from the registry and writing to current keys. However, it has nothing
for adding new keys which is something I need to do. Does anybody know
of any tools out there that I can use to do this? I know that it can be
accomplished with JNI, but I don't have a c++ compiler to create a dll
with so would rather use one that is already written.

Thanks.
Matthew
 
M

Matthew Zimmer

Manuel said:
Matthew,

Have you looked at Servertec Foundation Classes, www.servertec.com, it does
what you are looking for and more.

Manny

Thanks for the response, but from a quick scan over the site it appears
that servertec is a full fledged product. What I really need is just a
simple java program that allows me to programmatically add keys to the
registry from my program. Also, I'd prefer a free one. :)

Matthew
 
S

svenmeier

I've read somewhere that you can get access to the full registry
through reflection on protected methods of
java.util.prefs.WindowsPreferences.

Sven
 
M

Matthew Zimmer

svenmeier said:
I've read somewhere that you can get access to the full registry
through reflection on protected methods of
java.util.prefs.WindowsPreferences.

Sven

Now that's an interesting idea that I hadn't thought of trying.
However, I seem to be unable to get access to that class as java
complains that I'm trying to access a private class from outside the
package. I'm using this code to try to get the methods (just to see if
I can):

WindowsPreferences.class.getMethods();

Is there some other way to reflectively get a class for a protected
class outside of my package (other than ClassName.class)? If not, is
there some other way to get to the methods than the one I'm using?

Thanks.
Matthew
 
T

Tor Iver Wilhelmsen

Matthew Zimmer said:
I'm working on a program that I would like to have edit the Windows
registry. I found an open-tool called jst that is great for reading
from the registry and writing to current keys. However, it has
nothing for adding new keys which is something I need to do. Does
anybody know of any tools out there that I can use to do this?

Someone on JavaOne a couple of years back presented an API for
accessing the registry using JNDI; try searching for such a beast. It
most likely uses JNI underneath though, since the (loaded) registry is
just a data structure in RAM.
 
Joined
Jul 27, 2009
Messages
1
Reaction score
0
How to access Windows Registry from Java easy way

Matthew Zimmer said:
Hey all,
I'm working on a program that I would like to have edit the Windows
registry. I found an open-tool called jst that is great for reading
from the registry and writing to current keys. However, it has nothing
for adding new keys which is something I need to do. Does anybody know
of any tools out there that I can use to do this? I know that it can be
accomplished with JNI, but I don't have a c++ compiler to create a dll
with so would rather use one that is already written.

Thanks.
Matthew

Check here dude:

technobuz.com/2009/07/how-to-use-windows-api-in-java
 
Joined
Apr 15, 2010
Messages
1
Reaction score
0
JRegistry

You can try the complete JRegistry solution from caerustech.com/JRegistry.php . I think its free to use and should give you what you want as far as reading and editing windows registry.

Archibald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top