Java Geek Trick du Jour

I'm trying to compile some sample classes to learn how to use Apache Axis the Java webservices system. Part of Java is that it needs to know where to load class libraries from. This is normally set by the CLASSPATH environment variable.

Java stores class libaries in 'jar' files, (java archive). Unfortunately, some apps need dozens of jar files to compile / run, and the CLASSPATH variable can only point to individual JAR files, not say "This directory full of jar files".

So a fellow on #java suggested this:

export CLASSPATH=`echo mydir/*.jar | tr " " ":"`

Cute. Loads up the CLASSPATH variable with all the jars in a directory.


Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.23-en

Twitter

Sponsors!

About this Entry

This page contains a single entry by dbs published on March 24, 2005 10:17 AM.

Review: Bookworm was the previous entry in this blog.

Review: Rocket Mania is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.