-1

I am trying to run weka on linux server. The steps I followed as listed below: 1. I download a zipped archive containing Weka as given on http://www.cs.waikato.ac.nz/ml/weka/downloading.html

  1. I then unzipped the zip file.

  2. I next tried executing weka.jar using the command:

    java -Djava.awt.headless=true -jar weka.jar

I also simply tried: java -jar weka.jar This also gives me errors.

I have set the DISPLAY variable using setenv DISPLAY localhost:0.0. I have tried other values too such as DISPLAY 0

weka.jar has also been added to the PATH variable.

The error I am getting is as follows:

Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.awt.HeadlessException
   at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
   at java.awt.Window.<init>(Window.java:433)
   at java.awt.Frame.<init>(Frame.java:403)
   at javax.swing.JFrame.<init>(JFrame.java:202)
   at weka.gui.LogWindow.<init>(LogWindow.java:252)
   at weka.gui.GUIChooser.<clinit>(GUIChooser.java:215)
Could not find the main class: weka.gui.GUIChooser. Program will exit.

Any help would be appreciated.

Thank You

user2948166
  • 599
  • 1
  • 9
  • 17

3 Answers3

1

Perhaps you need to add the CLASSPATH. For example:

java -cp "$CLASSPATH:./weka.jar" -Xmx500m weka.gui.explorer.Explorer
riza
  • 16,274
  • 7
  • 29
  • 29
0

Google told me to run this command :

sudo apt-get install openjdk-6-jre
Michaël
  • 3,679
  • 7
  • 39
  • 64
0

When I did as following, it worked.

    1. Extract weka.jar to directoy named weka.
    1. Write a script runWeka.sh:
#! /bin/bash
WEKA_HOME="~/weka";
java -classpath $WEKA_HOME weka.gui.Main
    1. Run this script.
Sniper Law
  • 77
  • 1
  • 2