java jar invocation

Stefan Walter stefan at freebsd.org
Tue Sep 22 14:44:12 UTC 2009


Ronald Klop, 21.09.09, 23:53h CEST:

> You have to add all jars to the classpath explicitly. You can't specify a  
> directory with jars or use *.
> This is the easiest way I know.
> 
> for i in /usr/local/jarz/*.jar; do
>    CLASSPATH="$CLASSPATH:$i"
> done
> java -cp "$CLASSPATH" -jar foo.jar

Actually, I recently found out that you can use wildcards, but only since
1.6. See [1], section "Understanding class path wildcards".

Best regards,
Stefan

[1]: http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html


More information about the freebsd-java mailing list