Computing.Net > Forums > Programming > java wont find class

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

java wont find class

Reply to Message Icon

Name: neal
Date: April 11, 2008 at 11:03:50 Pacific
OS: XP Pro SP2
CPU/Ram: P4@3GHx/512mb
Product: Dell inspiron 9100
Comment:

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 free

C:\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



Sponsored Link
Ads by Google

Response Number 1
Name: Jimmytherifle
Date: April 11, 2008 at 19:31:10 Pacific
Reply:

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.


0

Response Number 2
Name: klint
Date: April 15, 2008 at 03:52:25 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: java wont find class

Programming in java www.computing.net/answers/programming/programming-in-java/7510.html

cannot Sort String Array in JAVA www.computing.net/answers/programming/cannot-sort-string-array-in-java-/8805.html

Java Currency Converter Application www.computing.net/answers/programming/java-currency-converter-application/10198.html