Over the past few days, I have been asked by my future father-in-law (I hope he doesn’t mind me calling him that) to put together a replacement program for an aging piece of software that he has been using. He said he didn’t mind doing some things from the command line, so I initially set out to write this program in C++. I used to love C++ and I still think it’s an all right language, but when I started writing this program I became extremely frustrated. It’s then that I realized that Java has spoiled me. There are many shortcomings of Java (as there are for most languages) but I happen to like Java. In fact, it’s probably my favorite programming language. I love being able to write one program and give it to people without having to worry about whether or not they can run it (as long as they have the Java Virtual Machine (JVM) that is). If I do my development on a different platform (and I usually do), I can rest assured that it’s going to work on any platform that there is a JVM for.
It is with that in mind (as well as my fondness for the language itself) that I switched gears and developed the application in Java. With Netbeans (a great Java integrated development environment (IDE)) I was able to create a quick graphical user interface for the program so that he wouldn’t have to worry about heading to the command prompt to run the thing. The only downside to Netbeans is that when it builds the application, it gives you a .jar file (container of the program’s class files that you wrote) and a directory (named “lib”) which contains the interface form information (i.e. information for the graphical user interface you’ve given your program). All that is fine. However, the annoyance comes in when you wish to send your application to someone. They are restricted to keeping the .jar file (which is executable by double clicking on it) in the same directory as the “lib” folder. If these two things are separated, the program will not run. It’s not a huge deal, just a bit annoying. I’ve been searching for a method of combining those two object into one file so that I’d only have one file to distribute but my search has come up fruitless so far.
The good news is that I have a working example of the program and so far everything seems to be working pretty well on it. The bad news is that I still have to distribute that .jar file and the “lib” directory. I guess you can’t win all the small battles.
No Responses to “A Cup of Java”
Leave a Reply