Im currently working on a java program and I need to read/write to the registry. i’ve looked at several API’s to do this and I found ini4j (ini4j Project Page). I also need to edit ini files so I like this solution because it does both. I’m curious if anybody has tried ini4j in this type of scenario?
Share
I found a better solution for reading/writing to the registry without the need for ini4j or passing arguments to the command line. I use JNA quite a lot in my program so I figured that it would be easier to use native library calls instead of including an additional library to do this for me. Here is an example from my project were I search through the registry looking for a specific key. The specific key is also dependent on whether or not the OS is x64 or x86.
I use objects to initially store the key values because I kept getting NullPointerExceptions. Feel free to provide another solution.