0.前提
系统已有java环境
1.解压缩安装包
caiyong@caiyong:/home/caiyong/setup/weka$sudo unzip weka-3-6-12.zip -d /opt/
caiyong@caiyong:/opt/weka$ sudo mv weka-3-6-12/ weka
caiyong@caiyong:/opt$ sudo chown -R caiyong ./weka/
2.配置环境变量
在/etc/profile中添加如下内容:
export WEKA_HOME=/opt/weka
export CLASSPATH=$CLASSPATH:$WEKA_HOME/weka.jar
验证:
caiyong@caiyong:/opt/weka$ source /etc/profile
caiyong@caiyong:/opt/weka$ echo $CLASSPATH
/opt/hadoop/libexec:/opt/hadoop/lib:.:/usr/java/jdk/lib/dt.jar:/usr/java/jdk/lib/tools.jar:/opt/hadoop/etc/hadoop:/opt/weka/weka.jar
3.运行
---Registering Weka Editors---
Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?
4.制作weka启动命令
写上以下内容:
cd $WEKA_HOME
java -Xmx1000M -jar weka.jar
caiyong@caiyong:~$ weka
bash: /usr/bin/weka: 权限不够
caiyong@caiyong:~$ sudo chmod 775 /usr/bin/weka
[sudo] password for caiyong:
caiyong@caiyong:~$ weka
---Registering Weka Editors---
Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?