Reputation: 51
Just started coding in Java, I have a lot of experience in VB. I really really would appreciate if someone can point me towards the right direction !
I am developing a simple application which should be able to run in Windows (xp, Vista, 7.. 32 & 64 bit) and on mac too.
Here are a few question I have :-
Any help resource links is highly appreciated so that I can hopefully do the same for someone else someday !
Upvotes: 5
Views: 5308
Reputation: 5586
1 and 3 have been answered pretty comprehensively now
You can modify the registry with this http://sourceforge.net/projects/jregistrykey/ library but it's fairly complex for a beginner and if you are looking at a cross platform application then there is no point making these changes, try keep your settings local to the Java application if possible.
Upvotes: 0
Reputation: 2788
1) May have to do different scripts to run the application? I've seen a run.sh and run.bat in many cases for kickstarting
2) No Idea, but I believe that if you want to be cross-platform you should avoid it (no registry on linux/osx). Using the registry not something java applications do a lot...
3) Don't know
I also believe that you are asking three distinct questions, an admin might help, but wouldn't it be better if you posted 3 questions instead of one?
Upvotes: 0
Reputation: 12393
Others have answered 1 and 3. I'll take a stab at 2.
No built in way to editing the registry in Java probably because Java was designed to be portable while the registry is only specific to Windows.
But Windows does have a command line program "reg" that lets you modify the registry and you can use Java to call the command line.
Upvotes: 0
Reputation: 74750
No. Java has the principle "compile once, run everywhere." - meaning, everywhere where you have a suitable JRE.
This holds as long as your application doesn't need to do platform-specific things (and even then it often is possible to either do these things with a platform switch in Java, or deliver a native library for each platform). If your application is "simple", you have a good chance that you don't.
If you only need registry changes for your own configuration, you should use java.util.prefs.*
(Which may, depending on the system, store them in the registry). There is no build-in way to access the registry, since not each system has a registry (nor needs it).
There is no build-in way to do this, but there are additional frameworks for this.
Upvotes: 3
Reputation: 82559
Upvotes: 2