This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Spark in Action and have Jean-Georges Perrin on-line!
See this thread for details.
Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Can't find class

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Oh, and...
Welcome to JavaRanch!
 
Kelly Rakes
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
    Bookmark Topic Watch Topic
  • New Topic