Impressed by Java

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 9, 2008 12:42 AM
Print

Comments on this entry:

# re: Impressed by Java

Left by Lou at 7/9/2008 1:08 AM
Gravatar
Yeah Java is kinda neat some times, my main gripe with it was I never found an IDE I liked that much. I ended up using Netbeans which was kind of cool, but I have to say that using Visual Studio all these years spoiled me :)

# re: Impressed by Java

Left by Tom at 7/15/2008 7:43 AM
Gravatar
The one thing I have not been able to figure out is how to call a Web service that was created with ASP.NET. Something is just not right.

# re: Impressed by Java

Left by tom hines at 9/16/2008 1:23 PM
Gravatar
For weeks my friends have been asking me Java questions and making snide jokes about my secret life. Not long ago I met a colleague for drinks and under her arm was a book on CSS. She just thought maybe I'd share some of my secret expertise on coding. I don't know much of anything about coding. Turns out, there are a few Tom Hines's in this world, one of whom uses the word "Geeeeeeeeeeeeeeeeeeeek!" in blog posts. I don't know what that means, exactly, but I want this Tom Hines to know, there are others ripping us off. And I beg moms and dads around the world to cool it with my name.

# re: Impressed by Java

Left by Roger Snowden at 9/18/2008 3:00 PM
Gravatar
Wow, I am shocked it took you this long to deal with Java. I just always imagined you were an enlightened bigot, but you turn out to be merely uninformed.

:-)

Welcome to the rest of the world, cap'n!

# re: Impressed by Java

Left by Tom Hines at 9/19/2008 6:08 AM
Gravatar
Uninformed might be right, ByTor, but that's got nothing to do with me being a bigot! I base it on who makes it easier for me to write the code! Originally, that equation took me to Borland, then to Microsoft (MS). I think the biggest plus for MS right now is Visual Studio (VS). It makes writing code such a pleasure and it's FAST compared to Eclipse. If I could write raw java in VS with all of the Microsoft goodness attached to the process, I would. Ah, but then there's C# which takes the best of Java and C++ and refactors out the uglies. As long as the target server is MS or MONO, there's no need to write in anything else. AND, Mr. Oracle-Guy, MS has made DB access a breeze. AND Mr. PL/SQL, I'm sure there are plenty things about DOT NET on which I am still VERY uninformed.

TEHIII

# re: Impressed by Java

Left by Jim Lawless at 1/9/2010 10:21 AM
Gravatar
Tom,

You should bottle that jar up in an EXE, now.

http://jimlawless.wordpress.com/2009/08/16/java-in-a-windows-exe-with-launch4j/

Your comment:



(not displayed)

 
 
 
 

Live Comment Preview: