hai all, i am trying to execute Java in Windows 98. I tried setting the CLASSPATH using the cmd, set CLASSPATH = classpath1;%CLASSPATH% It worked, and i am able to use 'javac'. But, once i close the dos prompt, the changes made to the CLASSPATH is not effective. Once again i have to make the changes. i want all changes made to be effective, every time i boot the system. And also, i am not able to open the autoexec.bat file in the root directory(C) using the notepad. Please help me. Thanks.
hmm.. not that I have tried on Win98 machine but you should be able to set the classpath once and forall by setting the classpath under "envirnoment variables" which you would by right clicking on my computer.--> properties-->advanced. Once you do that you should be able to run javac on any of dos prompts
Hi Kavitha Follow the steps in order : 1. Find out where java is installed. (directory would be somewhat like j2sdk1.4.0 for Java SDK 1.4) 2. Goto autoexec.bat, open it and add an entry like
This is in case you have Windows 95, 98. In case of Windows 2000/XP different steps need to be followed. 3. Before you compile/run any program restart the machine. 4. Make a file like say chapter1.java and save it in the folder "C:\J2SDK1.4.0\BIN\". 5. Compile and run the file. The file should now run. To edit the autoexec.bat, select autoexec.bat and right-click then choose edit from the menu or from the DOS prompt type
Now in the window that now opens add the entry specified above, after all the previous line/s(if any). I would suggest that you keep an entry in the autoexec.bat as well. To be sure copy the file with a different name like ae.bat or anything. Then in case you mess up with editing or anything you can again copy back/rename the ae.bat to autoexec.bat.
Hai all, Thanks for your help. In Windows 98, we dont have the option to set the "Environment variables" in "My Computer --> properties". So i entered the following in autoexec.bat set PATH=C:\j2sdk1.4.1_05\bin;%PATH% and just executed the following cmd. C:\> autoexec But, once i close the dos prompt, all the changes made are not effective. So when i open the dos prompt, once again i have to just execute the above cmd. There is no need to do the changes in autoexec.bat file. Your suggestions were really helpful. Thanks.
The advantage of putting the CLASSPATH changes in the "autoexec.bat" file is that when you re-boot the machine the environment is set based on those commands. So if you change the "autoexec.bat" file nothing happens until you re-boot. After you re-boot you'll never have to set the CLASSPATH again. Unless you need to change it later on. So there is a very real benefit by putting your changes in there.