
|
|
|||
Simplify Your Application Delivery with One-JARBy P. Simon Tuffs2005-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 |
||||
| About the NetVisits, Inc Network | Write For Us | Advertise Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy. |
Visit other NetVisits, Inc. sites: |