• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Looking up the System registry from java application

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

thanks,
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"); ?
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
He baked a muffin that stole my car! And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic