在ubuntu上安装weka

时间:2022-06-19 19:07:24

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中添加如下内容:


#weka environment

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.运行


caiyong@caiyong:/opt/weka$ java -Xmx1000M -jar weka.jar
---Registering Weka Editors---
Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?


4.制作weka启动命令


caiyong@caiyong:/opt$ sudo gedit /usr/bin/weka

写上以下内容:


#!/bin/bash
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?