Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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

Most Urgent!!!

 
Ranch Hand
Posts: 765
  • Mark post as helpful
  • send pies
  • 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
  • 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: 765
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Noops!!...stil waiting disperately.
Bye.
Viki.
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the output from your console window? Can you paste it here?
 
Vikrama Sanjeeva
Ranch Hand
Posts: 765
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Today's lesson is that you can't wear a jetpack AND a cape. I should have read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic