• 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

Most Urgent!!!

 
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,
Here is the problem.Plz reply soooooon.Here is the problem.
I have made the class TestClass & my package name is testPackage.Now i have put the TestClass.java in testPackage folder made at c: .I have compiled it easily that is resulting class file is present in testPackage< folder.Now when i am running it, it is saying that ClassNotFounError.
Remember i am using WIN98 & aslo WIN NT.So the cmd. which works on both WIN 98 & WIN NT is required & remember my jdk1.3 is at c: and my testPackage folder is at d:
What shall i do?.Is there any CLASSPATH story behind this.??
Help me plz. it is very urgent.
Bye.
Viki.
[ January 12, 2002: Message edited by: Vikrama Sanjeeva ]
[ January 12, 2002: Message edited by: Vikrama Sanjeeva ]
 
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your class file (.class, NOT the .java) needs to be in a folder named testPackage, so it's relative path is testPackage/TestClass.class
Assuming you have the folder testPackage at C:, so the full path for TestClass.class is
C:/testPackage/TestClass.class
from the console you would type
java -classpath C:/ testPackage.TestClass.
Hope this helps!
Rob
 
Vikrama Sanjeeva
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Noops!!...stil waiting disperately.
Bye.
Viki.
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the output from your console window? Can you paste it here?
 
Vikrama Sanjeeva
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Soory Rob.I got the correct o/p.This i cant believe it the difference b/w two commands
java -classpath C:/ testPackage.TestClass
java -classpath C:/testPackage.TestClass
Only the single space matters!!!
OH! MY GOD.
Anyway Thank U Very Much.U Have work me just like a 911 OR ANY SUPERMAN.
One last thing, that does it also workds on WIN NT?Currently i am using WIN 98.
Bye.
Viki.
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to hear it worked.
Yes, that same command will work on NT, assuming you set up your files the same way.
Btw, you can just type "java" at the command prompt and it will show you all the options you can use. I find it useful to create a batch file for all my applications, so I can manually set up the CLASSPATH variable before I call the java command. It makes it easy to just double-click the batch file to launch the application.

Rob
 
reply
    Bookmark Topic Watch Topic
  • New Topic