Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm trying to run a java program that I have written. It's very simple and just processes text, using a single class with just the two methods; it does not depend on anything else apart from an input file. It has compiled fine on this machine, and run on other machines, but when I try to run it on this machine, I get the following:
Directory of C:\weka
[.] [..] ARFFFormat.class
ARFFFormat.java cs239data.txt iris.arff
MyClassifier.class MyClassifier.java
6 File(s) 379,912 bytes
2 Dir(s) 11,360,374,784 bytes freeC:\weka>java ARFFFormat cs239data.txt
Exception in thread "main" java.lang.NoClassDefFoundError: ARFFFormat
Caused by: java.lang.ClassNotFoundException: ARFFFormat
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)So java can't find the class file even though it's right there and I just compiled it. Can anybody think what might be going on here? Thanks

I'm not really a Java expert, I've only been programming in it for about a year now, but I think I may be able to help. If you could include the source code, that might make the problem a bit easier to diagnose.

Is class ARFFFormat part of a package? If so, it will need to be in a subdirectory structure that reflects the package name.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |