This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to access the windows registry

 
Garry Kalra
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i access and make changes to the windows registry using java.
garry
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, you'll have to write some native code to access platform specific features.
But if you can write a dynamic library (dll) that accesses the Windows registry you can declare a native method in your Java code and access that method after loading the library with the System object.
Hope this helps
 
Steve Deadsea
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This work of writing native code to access the windows registry has of course already been done by various parties.
Microsoft has libraries to do so in the com.ms.wfc package. http://msdn.microsoft.com/visualj/technical/tutorial/wfcregistry/default.asp
However you only get those with J++ and I have no idea if you can legally get them elsewhere and redistribute them or not.
There is a products called JNDI that looks like it can do it:
http://www.cogentlogic.com/cocoon/CogentLogicCorporation/JNDI.xml
It also appears that the Java 1.4 preferences API can look into the Windows registry, here is an example:
http://www.esus.com/javaindex/j2se/jdk1.2/javautil/preferences/prefsaccessregistry.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic