2

how do you read registry keys in Java and then story that information into some kind of variable? furthermore, how do you create an installation binary so that you can distribute your product?

skaffman
  • 398,947
  • 96
  • 818
  • 769
rolling_codes
  • 15,174
  • 22
  • 76
  • 112
  • 1
    google "windows registry java" and possible duplicate of http://stackoverflow.com/questions/2627446/how-to-create-registry-key-through-java-program – Augusto Apr 30 '11 at 12:47
  • Old but might work: http://www.trustice.com/java/jnireg/ – gd1 Apr 30 '11 at 12:48
  • 1
    Duplicate of http://stackoverflow.com/questions/62289/read-write-to-windows-registry-using-java and many, many more. – Tom Anderson Apr 30 '11 at 12:59
  • The "furthermore ..." is a separate question, and should be asked separately. One question per question, please! – Tom Anderson Apr 30 '11 at 13:01

2 Answers2

2

You can use java.util.prefs to read and write to the registry. See this question for some examples.

Community
  • 1
  • 1
sbridges
  • 24,960
  • 4
  • 64
  • 71
0

There's no built-in way to read registry keys, but there are various third-party Windows-only libraries to do this. Of course, you should avoid it if you can -- why not write portable code that doesn't use the registry if you can? There's rarely a need.

Regarding installers, there are a number of products that do this: InstallAnywhere, for example.

Ernest Friedman-Hill
  • 80,601
  • 10
  • 150
  • 186