views:

92

answers:

3

This is a single question, but with a couple of sub questions. I am planning a Desktop application using Java and I am using NetBeans as the IDE. Questions:

  1. Why so many Javas? Java, Java SE, Java EE, Java Me

  2. I want the application to store data locally, what is best Java DB or SQLite?

  3. Do I need anything extra to create a setup file for my clients to install the application?

  4. Is it there a Java solution similar to .Net OneClick to keep the clients updated to the latest version of the application?

  5. I have plan to run the application in Windows, but if I have to ported to Mac or Linux how hard can it be?

+1  A: 
  1. Because you don't really need everything everywhere. For example you don't really need to use GPRS or SMS from you computer, or ORM from you phone. Each edition is targeted to a specific environment. This way you can have a lighter environment for mobiles, and a lot more components for enterprise applications (which you don't really need of a standard application).
  2. I would advise you to use JavaDB (or Derby) but it really depends on you
  3. Not really, you could offer a nice solution to install your application, but it's not necessary.
  4. There is (I don't remember, but other answers will certainly help)
  5. It's really easy, in particular for unix application, the executable creation will basically be a .sh file launched directly (you could of course have a real executable on UNIX, but it's really common and easyier to maintain to have .sh files) (you could also use .bat file on windows, but let's say that's just less common)

I re-read the question and might have not really answered the last point (I was still on .exe creation) so here is a second shot :

5.It's the main goal of java, to be ported everywhere. As long as your code doesn't use specificity of your system (or it's protected with ifs) your code will work everywhere. Of course you have to use the same java edition (edition, not version) and the same libraries or you could have problems.

Colin Hebert
+1  A: 
  1. There are different java libraries for different purposes. Java ME for instance, is designed for cell phones / mobile devices. You'll probably be fine with java SE, unless you need some of the features from EE.

  2. Depending on how complex your data storage is going to be, you may not even need a "database." In java, any object which implements the "serializable" interface can be written directly to a file. So, if you're just trying to store things such as user settings, etc, you can create an object to store them, implement Serialiazable, and write it to disc.

  3. Only if your application links to code libraries which you don't want packaged in the same directory. You can package it as a self-executing JAR from netbeans, it'll be similar in function to an .exe

  4. (Shrug.)

  5. If you are careful not to use operating system specific paths, a self-executing jar will work immediately on any operating system with the JVM installed. There may be a couple other quirks, but Java is built to be extremely portable.

Sam Dufel
"There may be a couple other quirks, but Java is built to be extremely portable." Java: write once, debug everywhere ;-)
Chris
I'm not really fond of serializing everything, modifying a class could mean that all data are lost. @Chris, is that a troll ?
Colin Hebert
True. You may end up having issues with any data storage system if you modify the schema, though.
Sam Dufel
@Colin Hebert: No, just a little humor.
Chris
+1  A: 
  1. Why so many Javas? Java, Java SE, Java EE, Java Me

So many environments. The first two are desktop, EE is server side, ME is phones.

..3. Do I need anything extra to create a setup file for my clients to install the application?

Use Java Web Start.

That also covers 4. & 5.

I have no opinion on which is the 'best' DB, but note that for small amounts of data, JWS provides mechanisms where even sand-boxed apps. can store and retrieve information, alternately the installer-desc element can be included in the launch file to install/set up the DB.

Andrew Thompson