Unix/Linux
I assume, that the mysql jar is located in the following directory:- /home/johndoe/jars/
- bash
export CLASSPATH=$CLASSPATH:/home/johndoe/jars/mysql-connector-java-3.1.8-bin.jar - c shell
setenv CLASSPATH $CLASSPATH:/home/johndoe/jars/mysql-connector-java-3.1.8-bin.jar
Unix/Linux uses the colon : as path separator, in contrast to Win32, which uses the semicolon ;.
Note: the prefixing with $CLASSPATH adds the mysql jar at the end of the currently existing CLASSPATH.
Scripts
This is a little start script for Weka Explorer, which can be adjusted easily. It also loads a mysql-connector:#! /bin/bash
# Path to weka
WEKA_PATH=~/weka/
# add mysql-connector (manually copied to weka path) and weka to classpath
CP="$CLASSPATH:/usr/share/java/:$WEKA_PATH/mysql-connector-java-5.0.5-bin.jar:$WEKA_PATH/weka.jar"
# use the connector of debian package libmysql-java
# CP="$CLASSPATH:/usr/share/java/:$WEKA_PATH/weka.jar"
echo "used CLASSPATH: $CP"
# start Explorer
java -cp $CP -Xmx500m weka.gui.explorer.Explorer
Tidak ada komentar:
Posting Komentar