Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use from the command-line? #1

Open
GoogleCodeExporter opened this issue Mar 21, 2015 · 5 comments
Open

Use from the command-line? #1

GoogleCodeExporter opened this issue Mar 21, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link


I'm using weka RandomForest from the command-line and tried to substitute
fast-random-forest. 

For example: 

java -cp weka.jar:FastRandomForest.jar
hr.irb.fastRandomforest.FastRandomForest ... lots of options ... -threads
<nthreads> 

and I get:

Exception in thread "main" java.lang.NoClassDefFoundError:
hr/irb/fastRandomforest/FastRandomForest

java -version

java version "1.5.0_15"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_15-b04, mixed mode)

In case I'm being stupid, can you add a section addressing this use-case?

Thanks,

- n

Original issue reported on code.google.com by [email protected] on 31 May 2009 at 1:44

@GoogleCodeExporter
Copy link
Author

I think my issues may be related to a mis-match between the non-source jar file 
and
my java versions. However, I'm having trouble compiling the source. Is there a 
build
script or ant file?

- n

Original comment by [email protected] on 12 Jun 2009 at 7:16

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

There are 2 distinct issues here, you can work around both by using a 1.6.0 
JDK/JRE.

1) The fastRf 0.98 source code won't compile with 1.5 javac as the code has 4
erroneous "@Override" annotations (FastRandomForest.java:628, 
FastRfBagging.java:561,
FastRandomTree.java:785, VotesCollector.java:59). If you remove them, the 1.5 
javac
should work ok.

2) The fastRf 0.98 binary has been compiled to require Java 1.6. In future 
versions,
this will be changed to Java 1.5 if it doesn't degrade performance.

Original comment by [email protected] on 13 Jun 2009 at 6:53

  • Added labels: Usability

@GoogleCodeExporter
Copy link
Author

correct the typo in the class name. 

Original comment by [email protected] on 16 Aug 2010 at 2:27

@GoogleCodeExporter
Copy link
Author

I'm having the same problem with Weka 3.6.2 and I am using Java 1.6. 

My command line:
$ java -cp weka.jar:FastRandomForest.jar 
weka.hr.irb.fastRandomForest.FastRandomForest
Exception in thread "main" java.lang.NoClassDefFoundError: 
weka/hr/irb/fastRandomForest/FastRandomForest (wrong name: 
hr/irb/fastRandomForest/FastRandomForest)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: weka.hr.irb.fastRandomForest.FastRandomForest.  
Program will exit.


My Java version:
$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)


My Weka directory:
-rw-r--r--  1 bronevet bronevet   17977 Jan 11  2010 COPYING
-rwx------  1 bronevet bronevet   85403 Oct 18 13:52 FastRandomForest.jar*
drwxr-xr-x  2 bronevet bronevet    4096 Oct 18 13:45 META-INF/
-rw-r--r--  1 bronevet bronevet   14368 Jan 11  2010 README
-rw-r--r--  1 bronevet bronevet 4386854 Jan 11  2010 WekaManual.pdf
drwxr-xr-x  2 bronevet bronevet    4096 Jan 11  2010 changelogs/
drwxr-xr-x  2 bronevet bronevet    4096 Jan 11  2010 data/
drwxr-xr-x  4 bronevet bronevet    4096 Jan 11  2010 doc/
-rw-r--r--  1 bronevet bronevet     510 Jan 11  2010 documentation.css
-rw-r--r--  1 bronevet bronevet    1863 Jan 11  2010 documentation.html
drwxr-xr-x  3 bronevet bronevet    4096 Jan 11  2010 java_cup/
-rw-r--r--  1 bronevet bronevet   30693 Jan 11  2010 remoteExperimentServer.jar
drwxr-xr-x 12 bronevet bronevet    4096 Oct 18 16:08 weka/
-rw-r--r--  1 bronevet bronevet 6265397 Jan 11  2010 weka-src.jar
-rw-r--r--  1 bronevet bronevet   30414 Jan 11  2010 weka.gif
-rw-r--r--  1 bronevet bronevet    2238 Jan 11  2010 weka.ico
-rw-------  1 bronevet bronevet 6462532 Oct 18 16:09 weka.jar

Original comment by [email protected] on 18 Oct 2010 at 11:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant