aspose file tools*
The moose likes Beginning Java and the fly likes Can't find class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can Watch "Can New topic
Author

Can't find class

Kelly Rakes
Greenhorn

Joined: Jun 26, 2002
Posts: 3
Please help,
Excuse the newbee question
I have compiled code and can see .class files in the directory I am working in, but when I type the command line java classname it I get the message "Can't find class classname"
Thanks in advance
Kelly Rakes


<a href="mailto:kellyrakes@hotmail.com" rel="nofollow">kellyrakes@hotmail.com</a>
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
What is the exact command that you are trying to use and what directory are you working in? Is it the same directory where the class file is?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Oh, and...
Welcome to JavaRanch!
Kelly Rakes
Greenhorn

Joined: Jun 26, 2002
Posts: 3
The directory is pretty long
"D:\jdev9i_rc2\jdev\mywork\Kellys\Registrar\src\Registrar"
When I navigate to that directory in the command shell and type javac classname.java it compiles and places a file classname.class in the directory. I have placed the directroy listed above in the class path as directed for W2K setup, I have also changed the runtime classpath by typing java -classpath D:\jdev9i_rc2\jdev\mywork\Kellys\Registrar\src\Registrar.
Any help would be apriciated
Thanks in advance
Kelly Rakes
Greenhorn

Joined: Jun 26, 2002
Posts: 3
Also the exact command is "java classname"
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

1.) Try to put a .(dot) in your CLASSPATH.
2.) If the java source has a package in the top, you need to compile like this: javac com/sun/java/Test.java and run the code like this: java com.sun.java.Test
/Rene


Regards, Rene Larsen
Dropbox Invite
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't find class