• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please include me in your group

 
Sonali Joshi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
I am a new comer,please clude me too in your group.
I too have decided to give this Scjp exam.
I have downloaded jdk1.2.2 .
Each time i open a command prompt i have to set the class path.
I have set it like this.
D:\ set path=D:\jdk1.2.2\bin;%path%D:\jdk1.2.2\jre\bin;%path%
I have heard that u have to store this in a batch file in order not to repeat this.I do not know how it has to be done.Please can anyone suggest how to do it.
Then i have used this path
D:\jdk1.2.2\sonali>edit a.java
And have written a small program in order to check if everthing is working fine.
But when i write javac a.java
It is saying cannot read the file a.java.
I am unable to proceed and i do not have anyone to help me.
So please could anyone tell me where i am wrong
Thankyou in advance
Sonali


D:\jdk1.2.2\
 
Fei Ng
Ranch Hand
Posts: 1245
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to read the README for java SDK.
if i remember right....
on win 98 or 98, you have to put the path in the autoexec.bat file.
on win NT system, you have to put it in your window enviornament.
on unix, you can put it in the .bash for bash shell.
I don't have the detail for that now. But you can find it on the readme file of the SDK. I will try to give you more INFO on it.
 
Sonali Joshi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Feing
I have Win NT.
And i did not get you, you said put it in Windows enviroment.
What do you mean by that.
Regards
Sonali
 
Matthew Margolis
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
control panel, system, environmetal variables it should be in there, if its not click in the box and add a variable name Classpath and path and set them to what you want.
 
Sonali Joshi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes Mathew
I have done accordingly.
Variable name i have given is classpath
and path as D:\jdk1.2.2\bin;%path%D:\jdk1.2.2\jre\bin;%path%
And on command prompt
D:\jdk1.2.2\sonali>javac a.java
But i am getting The name specified is not an internal or external command,operable program or batch file.
What does this mean.
If i type just javac also i get the same error.
Please help.
I would really apreciate it,as i now this is out of topic.
Regards
Sonali
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for WNT
control panel_ system _ enviroment
threre are two subwindows one for the variables of the system and one for the variables of the user your are currently longon.
Logon the system with the user you are going to develop Java. Go to the subwindow where the enviroment variables for the user are. Click any of them and overwrite for setting path in variable, and c:\jdk1.x.x\bin for the corresponding value.
Check typing path in the DOS console.
Maybe this tread should be moved to the beginner forum.
 
Fei Ng
Ranch Hand
Posts: 1245
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sonali, i see.
So what error mesg are you getting right now??
oh oh oh and welcome to javaranch!

[This message has been edited by FEI NG (edited December 02, 2001).]
 
Sonali Joshi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Feing,
i am getting this error.
The name specified is not an internal or external command,operable program or batch file.
What does this mean.
If i type just javac also i get the same error.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That means that your PATH (the variable name is case-sensitive, "path" is not the same as "PATH") environment variable does not contain the directory that contains the java.exe (and javac.exe) program.
You have to set that variable before running the program.
Short-term solution:
open a DOS console and at the prompt type:
D:\> set PATH %PATH%;d:\jdk1.2.2\bin;d:\jdk1.2.2\jre\bin
press return key
then at the prompt you can run javac (or java) by typing
D:\> javac myProg.java
and/or
D:\> java myProg
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
[This message has been edited by Valentin Crettaz (edited December 02, 2001).]
 
Sonali Joshi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir,
I have done it.
But now when i type javac a.java.
It is saying can't read a.java.
Regards
Sonali
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if javac can't find your java source file, it means that it doesn't know where to find it.
Try this:
go into the directory where your sources are and then type
javac -classpath . myFile.java at the prompt.
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Uma Viswanathan
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Check whether you have a.java file in the directory from where are you executing the command javac a.java
2) Check whether the name of the class which contains the main method is same as the filename without extension ( i.e, since your filename is a.java, the class which contains main method must be a )
 
Sonali Joshi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uma ,i do have everthing what ever you have mentioned
Valentin,
I have typed
D:\jdk1.2.2\abcd>javac a.java
still the same problem.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you forgot to type the classpath option
D:\jdk1.2.2\abcd>javac -classpath . a.java
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
lila2000
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Copy paste your auoexec.bat file so that u can get proper answer.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This discussion is not related to SCJP.
I have to move it to Java in General (Beginner).
lila2000,
I have to ask you to read the Javaranch Naming Policy and register again.
Thanks for your cooperation

------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
[This message has been edited by Valentin Crettaz (edited December 03, 2001).]
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uma,
When you are saving your .java file, are you saving it as a text file? If you are using MSWord or something, the format will confuse the compiler.
 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Valentin is trying to tell you to add the current directory (which is represented by a single dot) in your classpath. That way it will look in whatever directory you're currently in when looking for your class files.
------------------
Michael J Bruesch
Codito, ergo sum...
I code, therefore I am.
My Java Games, I'm quite proud
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic