| Author |
Difficulty in setting the class path variable
|
prachi mishra
Greenhorn
Joined: Aug 21, 2008
Posts: 7
|
|
Hello friends I am trying to complie a java program in textpad, but the compiler cannot find the file specified. I have set the enviornmental variable. Could you please help me out on this? [ September 23, 2008: Message edited by: prachi mishra ]
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16680
|
|
If you can't compile the program, how are you running the program??? Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
prachi mishra
Greenhorn
Joined: Aug 21, 2008
Posts: 7
|
|
Ohh im sorry. Actually at that time i ran a previously compiled program. [ September 23, 2008: Message edited by: prachi mishra ]
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16680
|
|
Well, we definitely need more details... What is the classpath? What is the command that you are using to compile? Command to run? The exact error message? etc. Henry
|
 |
prachi mishra
Greenhorn
Joined: Aug 21, 2008
Posts: 7
|
|
I have followed the following steps - 1- In Control Panel click on System. 2- Click on the advanced tab. 3- Click on Environmental variables 4- Create a new user Environmental variable 5- I have set the variable name as classpath and variable values as .;%CLASSPATH%. 6- Apply the changes and exit the dialog boxes. 7- In textpad go to Configure-Preferences-Tools- Complie java 8- In compile java set the parameter as -classpath . $FILE and initial folder as $FileDir. 9- In compile java set the parameter as -classpath . $BaseName and initial folder as $FileDir. I am getting the error as " The system cannot find the file specified." [ September 23, 2008: Message edited by: prachi mishra ]
|
 |
Leonid Shchervinsky
Ranch Hand
Joined: Sep 07, 2006
Posts: 32
|
|
Hi Prachi: Is there a reason you are using TextPad and not a full featured IDE like NetBeans 6.1? There are differences between the two, including price... Leonid
|
<a href="http://www.shchervinsky.com/java/" target="_blank" rel="nofollow">http://www.shchervinsky.com/java/</a>
|
 |
prachi mishra
Greenhorn
Joined: Aug 21, 2008
Posts: 7
|
|
|
I have used textpad previously and iam comfortbale with that. I have never used netbeans 6.1
|
 |
Leonid Shchervinsky
Ranch Hand
Joined: Sep 07, 2006
Posts: 32
|
|
Originally posted by prachi mishra: I have followed the following steps - 1- In Control Panel click on System. 2- Click on the advanced tab. 3- Click on Environmental variables 4- Create a new user Environmental variable 5- I have set the variable name as classpath and variable values as .;%CLASSPATH%. 6- Apply the changes and exit the dialog boxes. 7- In textpad go to Configure-Preferences-Tools- Complie java 8- In compile java set the parameter as -classpath . $FILE and initial folder as $FileDir. 9- In compile java set the parameter as -classpath . $BaseName and initial folder as $FileDir. I am getting the error as " The system cannot find the file specified." [ September 23, 2008: Message edited by: prachi mishra ]
Here are some of the changes for your process: > environment variable name: CLASSPATH > must contain: ;. > keep all the default in TextPad > Ctrl+1 to compile > Ctrl+2 to run Hope this helps. Leonid
|
 |
prachi mishra
Greenhorn
Joined: Aug 21, 2008
Posts: 7
|
|
Thanks guys ..its working now
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
|
Shouldn't this be in the Beginner Section???
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
 |
|
|
subject: Difficulty in setting the class path variable
|
|
|