On Sat, Jun 14, 2003 at 08:12:23PM -0400, Paul Tremblay <[EMAIL PROTECTED]> wrote:
> For example, I have installed xalan. In my ./bashprofile, I have:
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/xsltc.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/BCEL.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/bsf.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/java_cup.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/JLex.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/regexp.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/runtime.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/regexp.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/xalansamples.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/xalanservlet.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/xercesImpl.jar
> export CLASSPATH=$CLASSPATH:/home/paul/java/jars/xalan-j_2_3_1/bin/xml-apis.jar
> 
> This gets real tedious. And this is for just one application. 
> I know with python, for example, you can just tell python to look in one
> folder for all the libraries. 
> Is there a way to do this with java? Is there an easier way to create
> the CLASSPATH?

Depends.  You can do a couple things:

First, write a script to run the application, and have this 
script set the classpath appropriately.

Second, write a .jar that can be run with java -jar example.jar 
containing all the classes you need.

Third, some java libraries can be dropped into a specific 
location within the JDK (for a blackdown JDK under 
/usr/local/jdk, this is /usr/local/jdk/jre/lib/ext) and they will 
be automatically loaded.

Fourth, the application itself can load .jar files from a 
specific location and otherwise manipulate the classpath.  Tomcat 
(the example servlet engine) does this extensively.

Typically, you write a script for individual applications, put 
system libraries and JDBC drivers into the JDK's auto-load 
location, and use -jar for installation packages.

-- 
Matthew Hunter ([EMAIL PROTECTED])
Public Key: http://matthew.infodancer.org/public_key.txt
Homepage: http://matthew.infodancer.org/index.jsp
Politics: http://www.triggerfinger.org/index.jsp


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to