BASH to load CLASSPATH from dir

When you have a lot of jar files that need to be loaded into the CLASSPATH especially if the jar’s are upgraded and change there name often, updating the Manifest file or the command line arguments is a pain.

This script will load all of the jars from a lib dir before starting up your application. That way when you have a new jar you can just drop it in your lib directory (and remove the old one).

#/bin/bash

for i in /MYAPP/lib/*; do
	echo adding $i to CLASSPATH
	CLASSPATH=$i:$CLASSPATH
	export CLASSPATH
done;

/usr/local/java/bin/java com.kumkee.application.Main

No Comments to “BASH to load CLASSPATH from dir”  

  1. No Comments

Leave a Reply