Presents your JAVA E-NEWSLETTER for June 2, 2003 <-------------------------------------------> MAKE RUNNING APPS EASIER WITH FOREHEAD Writing a complex application in Java is easy compared to deploying and running it. However, you can make running your application much easier, regardless of the complexity of your classpath, by using the open source tool called forehead. Beyond simple application execution, forehead provides sophisticated control of Java ClassLoaders. To use forehead, you create a script or batch file that starts forehead, which, in turn, starts your application. Here is the batch file used to start forehead: java -Dapp.home=. -Dforehead.conf.file=forehead.conf -cp forehead-1.0-b4.jar com.werken.forehead.Forehead %1 %2 %3 %4 %5 The heart of the forehead system is the forehead configuration file. In the configuration file, you can import system properties, define class loaders, and specify an application starting point. Forehead loads classes using the ClassLoaders you define, in the order you define them. This gives you total control over how your applications' classes are loaded. This can be particularly helpful when you have libraries that contain duplicate files (though this scenario isn't preferable, it's sometimes a reality). Not only can you define ClassLoaders, but you can also define hierarchies of ClassLoaders, where one ClassLoader depends on one or more parent. The following is a simple forehead configuration file: +app.home [root] ${app.home}/ ${app.home}/lib/activation.jar ${app.home}/lib/commons-collections.jar ${app.home}/lib/commons-lang-1.0-b1.1.jar ${app.home}/lib/GenJavaCore.jar ${app.home}/lib/j2ee.jar ${app.home}/lib/log4j-1.2.6.jar ${app.home}/lib/mail.jar ${app.home}/lib/simple-jndi-0.4.jar ${app.home}/lib/flashchecker.jar =[root]com.genscape.flashchecker.Client If your applications and their classpaths are nontrivial, then take a look at forehead. Even if your classpaths aren't complex, forehead can make executing your applications more manageable. http://forehead.werken.com/ ----------------------------------------