Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing classes

Status
Not open for further replies.

mphayesuk

IS-IT--Management
Apr 22, 2003
46
GB
I am using JGrasp to edit with SDK1.4.1 I have entered the line: import quotesystem.*;

and I know that the class file is in the same place as the main class file and still it cant be found any ideas.

Thanks
 
You need to set your CLASSPATH environment variable to the directory where your classes are.
 
Right I am using a program call JGrasp and windows xp I have changed the environment variables in my computer to add in CLASSPATH and point it to my classes, as far as I am aware the variables in JGrasp are set up the same. Just to let you know I am not a newbie at this, but its driving me up the wall it should work and it doesn't. Is there anything else you can think of.

Thanks
 
What is the error ?

If its ClassNotFoundException, then its definitely a CLASSPATH issue.

I've never used JGrasp, but if you are a newbie, I would recommend using a simple text editor such as vi/emacs/notepad/textpad and the command line javac.exe compiler until you are happy with basic java compilation and execution.
 
Got it sorted, the classpath was right but I was putting package at the start of every new java file that was part of my project, but no where does it say that the folder you place the files in has to be the same as the package name..... never mind its working now so thanks for your help. Check out my other post I need some major help on this one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top