• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can't find class

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, and...
Welcome to JavaRanch!
 
Kelly Rakes
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also the exact command is "java classname"
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic