Deployment Options

I got a new idea for a computer program I want to write. First I need to walk the thing all the way through to completion. I need users to be able to run this program on their own machines. I am thinking about using Java for the coding, but want to ensure a smooth user experience.

To run the Java bytecode on their machines, the users will need the Java Runtime Environment. What if they do not have it on their machine? Or what if they have the wrong version? I need my software to work the very first time, and every time after that.

I did some research on the subject. I can package up my files as a jar. However this still requires the JRE to be installed. Or I could go the web way and use Java Web Start. That would require me to set up a web server to host the apps. Then they will get downloaded to the user machine. That might require too much infrastructure for me.

I could also distribute the program as an applet. Then the whole thing runs in the browser. This also requires some infrastructure. But it will just be a web page. I do not have a lot of experience with applets using Java. That is a consideration.

Finally there are some compilers that produce executables that run directly on the user's native machine. This is the next best thing to developing with a language like C++ and compiling a version for the target machine. I need to play with ohe of these programs that produces a stand alone Java executable before I make a final decision.

Back to Java

I have been spending time learning JavaScript over the past year or so. However now it is time to return to Java. Later this year I plan to take an advanced Java class in school. However for now I am writing some small utlities in Java.

I was surprised at how rusty I got. You need to use your skills to keep them current. I coded a simple switch statement. Being a good developer, I tried to use some constants in the labels of the switch statement. They did not work. Ooops. I forgot to make those constants "final".

There was something that surprised me a bit. I put together a switch statement that initialized a variable. I included a default label in the switch clause. So all paths through would get the variable initialized. However the compiler still gave me a warning that the variable might not be initialized.

It was a small thing. But I don't want any warnings in my code. So I had to blatantly initiallize my variable. Not so clean.