I download the Jigsaw server source from w3c website, http://www.w3.org/Jigsaw/. I followed its instruction http://www.w3.org/Jigsaw/Doc/Programmer/compile.html, but still can not compile it on my linux. What does it mean to update your CLASSPATH to compile Jigsaw开发者_开发技巧 and use the new compiled classes? How could I set my classpath?
Plz give me some help.
Thanks.
It means you need to set the $CLASSPATH
environment variable. I haven't looked at Jigsaw, but if you wanted to set your $CLASSPATH
to include all the jar files within a directory (for example one that contains all the Jigsaw compiled jars) then you can use this script fragment:
CLASSPATH=""
for j in $(find /path/to/jigsaw/lib -name \*.jar)
do
if [ ! -z "$CLASSPATH" ]; then CLASSPATH="$CLASSPATH:"; fi
CLASSPATH="$CLASSPATH$j"
done
Now whenever you invoke the java
command it will use the classes within /path/to/jigsaw/lib
.
However this is not a good idea; better is to use the above technique to build an environment variable other than $CLASSPATH
and pass that as the argument to the java -cp
command line option:
cp=""
for j in $(find /path/to/jigsaw/lib -name \*.jar)
do
if [ ! -z "$cp" ]; then cp="$cp:"; fi
cp="$cp$j"
done
java -cp $cp ...
精彩评论