• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Looking up the System registry from java application  RSS feed

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • 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
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!