• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing Windows Registry thro' Java

 
J Bug
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
need to access the Windows Registry (95/98/2000/XP) from Java code.

The requirement is as follows:
Winamp 2 has been installed on a PC and my program needs to read the registry to find out in which folder it is installed; change to that folder and execute the Winamp program.

I am using JDK 1.4.2. Can anyone help me with the source code?

All help highly appreciated.
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to write C code to access the registry and then access that C code via JNI. I can help with JNI; unfortunately, I don't know how to access the registry from C code.
A quick Google search provided the following:

> There's a package available at one of the great Java repositories
> (the Giant Java Tree at http://www.gjt.org). The package you are
> looking for is:
>
> com.ice.jni.registry
>
> One warning: it is under the GPL License (i.e. not LGPL), so you
> might have licensing issues.
>
> -Ray

See here for a direct link.
Again, note the warning regarding the GLP license.
Hope that this helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!