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
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.
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
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.
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).]
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
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 )
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>