
OK. I've finally seen something in Java that impressed me. It's the JAR! (Java Archive)
Most folks would know that I'm a Microsoft fan (C++, C#) and have stayed away from Java; mainly because it's more difficult to get things done (in Java) and too hard to leverage legacy code written in C++. I had always been a static linking guy because it allowed me to deliver ONE THING (just the exe) to the end user or server. Deleting the app after it has run its lifecycle is pretty easy when there is ONE THING to delete. Well, I had backed off of that a little when i started doing .NET because everything is dynamically linked -- but the deploy feature still allows the single keystroke to push the THING(s) to the server.
I had never done anthing I considered REAL in Java; meaning I had created a bunch of "proof of concept" apps, but nothing I would trust as a dedicated production app.
This past week (while on vacation), I decided to write a production utility in Java (just for kicks) and one thing led to another (using just the JDK, by the way...):
Class became collection
Collection became library
I had heard of the JAR and wanted to see what it would take to "not have all of those class files laying around in my science directory". I found the JAR utility and in a few minutes had figured out how to archive the classes and include the thing in my classpath. This was still a little "steep", however, especially if I expected someone else to use the JAR.
A little web surfing led me across the command:
java -jar blahblah
When I tried that command with my JAR, it laughed at me saying the Main-Class tag was missing from my manifest.
AHA -- THE MANIFEST!
A little while later, I had that thing humming with ALL of the classes in one JAR; and I could do this without having to further mangle the classpath.
Maybe I'll try another REAL project in Java.
Tom
posted @ Wednesday, July 09, 2008 12:42 AM