spacer
Web Development Tutorials JAVA Tutorials
 Developer Newsletter

Tutorials
AJAX
ASP
CGI & Perl
CSS
Flash
HTML
Illustrator
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML
Miscellaneous


Scripts Directory
AJAX Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Web Hosting Directory
ASP.NET
Budget
Dedicated Servers
Ecommerce
Linux
Resellers
Shared
Small Business
Windows

Developer Manuals
Learn HTML
Learn PHP
Learn CSS
Learn AJAX
Learn JavaScript
Learn Pear
Free White Papers

Developer Resources
Developer Tools
Developer Content
Survey Software
Dedicated Servers




Simplify Your Application Delivery with One-JAR

By P. Simon Tuffs
2005-04-22


Power Programming with Custom Classloaders

If you've ever tried to deliver a Java application as a single Java Archive file (JAR file), you've most likely encountered the need to expand supporting JAR files before you build the final archive. As well as being a development nuisance, this can put you in violation of license agreements. In this article, Simon Tuffs introduces you to One-JAR, a tool that uses a custom classloader to dynamically load classes from JAR files inside an executable JAR file.

It has been noted that history repeats itself, first as tragedy and then as farce. I recently experienced this first hand when I had to deliver a runnable Java application to a client. I've done this many times and it's always fraught with complications. There is plenty of room for error when gathering all of an application's JAR files, writing the launch scripts for DOS and Unix (and Cygwin), and making sure that the client's environment variables all point to the right place. If everything goes perfectly the application will arrive and run as it should. When things go wrong, as they usually do, many hours of client-side support are the result.

After recently talking a bemused client through a host of ClassNotFound exceptions, I decided I'd had enough. I was going to find a way to pack my application into a single JAR file and give my clients a simple mechanism (such as java -jar ) to run it.

The result is One-JAR, a very simple software packaging solution that utilizes a Java custom classloader to dynamically load all your application classes from inside a single archive, while preserving the structure of supporting JAR files. In this article, I'll walk you through my process of developing One-JAR, and then tell you how to use it to deliver your runnable applications in a self-contained file.

Tutorial Pages:
» Power Programming with Custom Classloaders
» Overview of One-JAR
» Problems and solutions
» Enter the JarClassLoader
» Loading Resources
» Bootstrapping the JarClassLoader
» In Conclusion
» Resources


First published by IBM DeveloperWorks


 | Bookmark Print |   Write For Us
Related Tutorials:
» All about JAXP, Part 1
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Develop Aspect-Oriented Java Applications with Eclipse and AJDT



About the NetVisits, Inc Network | Write For Us | Advertise
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: