Jeebus
Jeebus

Reputation: 51

Making Java Application for Windows & Mac

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 :-

  1. Do I need to make multiple versions for each windows(xp, Vista, 7.. 32 & 64 bit ) & Mac?
  2. How do we make changes to registry any inbuilt in java ?
  3. Make the application auto Updating

Any help resource links is highly appreciated so that I can hopefully do the same for someone else someday !

Upvotes: 5

Views: 5308

Answers (5)

rogermushroom
rogermushroom

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

Dimitrios Mistriotis
Dimitrios Mistriotis

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

Steve
Steve

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

Paŭlo Ebermann
Paŭlo Ebermann

Reputation: 74750

  1. 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.

  2. 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).

  3. There is no build-in way to do this, but there are additional frameworks for this.

Upvotes: 3

corsiKa
corsiKa

Reputation: 82559

  1. No, you don't. As long as your application is self-contained you'll be just fine.
  2. That I'm not sure, I'd have to get back to you and edit it in. :-(
  3. The Eclipse RCP framework makes auto-updating pretty darned easy.

Upvotes: 2

Related Questions