wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Please include me in your group Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Please include me in your group" Watch "Please include me in your group" New topic
Author

Please include me in your group

Sonali Joshi
Greenhorn

Joined: Dec 01, 2001
Posts: 8
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\


sj
Fei Ng
Ranch Hand

Joined: Aug 26, 2000
Posts: 1242
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

Joined: Dec 01, 2001
Posts: 8
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

Joined: Sep 29, 2001
Posts: 32
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

Joined: Dec 01, 2001
Posts: 8
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

Joined: Jul 03, 2001
Posts: 2120
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.


SCJP2. Please Indent your code using UBB Code
Fei Ng
Ranch Hand

Joined: Aug 26, 2000
Posts: 1242
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

Joined: Dec 01, 2001
Posts: 8
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

Joined: Aug 26, 2001
Posts: 7610
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).]


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Sonali Joshi
Greenhorn

Joined: Dec 01, 2001
Posts: 8
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

Joined: Aug 26, 2001
Posts: 7610
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

Joined: Jun 14, 2001
Posts: 126
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

Joined: Dec 01, 2001
Posts: 8
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

Joined: Aug 26, 2001
Posts: 7610
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

Joined: Dec 03, 2001
Posts: 1
Copy paste your auoexec.bat file so that u can get proper answer.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
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

Joined: Sep 29, 2000
Posts: 8521
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.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Michael Bruesch
Ranch Hand

Joined: Sep 23, 2001
Posts: 158
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


Michael J Bruesch<br /><i>I code, therefore I am.</i>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please include me in your group
 
Similar Threads
urgent help needed
Please Help----very urgent
JAVA Compiler Installation
tomcat 4.0 configuration
Running a Java Program