×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

java can't find my class
3

java can't find my class

java can't find my class

(OP)
When I run java at the command line, (ie. C:\java myclass) java returned an error that it could not find my class.

I verified that the CLASSPATH contains the path to my class directory.

It also happened on both of my computer, one's running Windows NT, one's running Windows 98.

Both machines are cleaned with Visual Cafe 2.5 as the only Java IDE.

Please help. Thanks

RE: java can't find my class

There are a couple of things to check:

1) Java is case sensitive, is 'myclass' the name of the class or is it MyClass?

2) You indicate that 'myclass' is in your class path. Does it have a package name: package mypackage; If so, your command line should be 'java mypackage.myclass'?

3) Lastly, if the only java you have installed is Visual Cafe, older versions used to use the classpath setup in their INI file (I don't know if that is still the case). Make certain that classpath is correct.

RE: java can't find my class

You might add the . ( current directory ) to your CLASS_PATH variable , because if it is a new compiled class then it will be in your current dir.

RE: java can't find my class

You might add the . ( current directory ) to your CLASS_PATH variable , because if it is a new compiled class then it will be in your current dir.

RE: java can't find my class

2
Another common gotcha is that the jvm usually gives this message when a dependent class is not in the CLASSPATH. Example: x extends y. You are trying to load x, but y is not available. The jvm will say x is not found....

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close