aspose file tools*
The moose likes Java in General and the fly likes Looking up the System registry from java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Looking up the System registry from java application" Watch "Looking up the System registry from java application" New topic
Author

Looking up the System registry from java application

marys joseph
Greenhorn

Joined: May 14, 2004
Posts: 20
Hi,

I would like to look up system's registry, how can I do that in java?

thanks,
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

My system has no registry.

I don't know, why we have a linux and mac forum, but no windows forum.
Perhaps to few windows-users

Perhaps File registry = new File ("/path/to/registry"); ?


http://home.arcor.de/hirnstrom/bewerbung
savas karabuz
Greenhorn

Joined: Feb 24, 2004
Posts: 16
Hi,

AFAIK there is no standart Java API to access Windows registry. You can develop your own JNI wrappers, or use available open-source implementations.

You can go through the following web page :

jRegistry Key

Hope this helps...
[ May 26, 2004: Message edited by: savas karabuz ]
marys joseph
Greenhorn

Joined: May 14, 2004
Posts: 20
Thanks for your replies.

I downloaded jregistry but I am unable to follow the user requirements. I kept jregistry.jar in the class path. and .dll file in c:\windows\system32

Still I can not import import ca.beq.util.win32.registry.*;

what am I doing wrong? If anyone is using jregistry please let me know,
savas karabuz
Greenhorn

Joined: Feb 24, 2004
Posts: 16
Hi again,

It's definitely a classpath issue, you can put jRegistryKey.jar in jre\lib\ext folder under your java home directory (C:\j2sdk1.4.2_04\jre\lib\ext on my machine, for example), jRegistryKey.dll can be put anywhere on Windows'PATH (system32 folder is OK). Here is a sample program i have tried and seen working which i copied from jRegistryKey Users Manual.

import ca.beq.util.win32.registry.*;
import java.util.*;

public class AccessRegistry {
public static void main(String[] args) {
RegistryKey r = new RegistryKey(RootKey.HKEY_CURRENT_USER, "Software");
if(r.hasSubkeys()) {
Iterator i = r.subkeys();
while(i.hasNext()) {
RegistryKey x = (RegistryKey)i.next();
System.out.println(x.toString());
} // while
} // if
}
}

Hope this helps...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Looking up the System registry from java application