This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi all Can anyone tell me how to set my classpath so i can compile my source code whether it is saved in the bin or anywhere on my hard drive. I have been saving all my .java files in the bin directory and then on the c prompt i have been using c:\jdk1.2.2\bin>javac MyFile.java to compile my code. I want to be able to save my source file elsewhere and run the javac without going to the bin everytime. Please help !
Noah Carroll
Ranch Hand
Joined: Sep 20, 2000
Posts: 96
posted
0
Gina, The classpath is not what allows you compile programs from any directory. You need to set your path. The best way to do this is to run sysedit and open your autoexec.bat file and add c:\jdk1.2.2\bin to the end of the path line. Do not delete the original path, only add that line.
Perhaps the Installation instructions can help it covers setting your path and classpath plus a real good explaination of what classpath means and how java uses it. Hope this helps
Originally posted by Noah Carroll: Gina, The classpath is not what allows you compile programs from any directory. You need to set your path. The best way to do this is to run sysedit and open your autoexec.bat file and add c:\jdk1.2.2\bin to the end of the path line. Do not delete the original path, only add that line. I hope this helps Noah Carroll noahcarroll@juno.com
When i run autoexec.bat this is what i get SET BLASTER=A240 I5 D1 T4 LH C:\WINDOWS\AU30DOS.COM @ECHO OFF rem rem *** DO NOT EDIT THIS FILE! *** rem rem This file was created by the System Configuration Utility as rem a placeholder for your AUTOEXEC.BAT file. Your actual rem AUTOEXEC.BAT file has been saved under the name AUTOEXEC.TSH. rem
SO I OPENED AUTOEXEC.TSH AND THIS IS WHAT I GOT......I DONT SEE THE WORD "PATH" ANYWHERE @C:\PROGRA~1\NORTON~1\NAVDX.EXE /Startup SET BLASTER=A240 I5 D1 T4 LH C:\WINDOWS\AU30DOS.COM @ECHO OFF REM [Header] REM [CD-ROM Drive] REM C:\WINDOWS\COMMAND\MSCDEX /D:MSCD001 REM [Miscellaneous] REM [Display] mode con codepage prepare=((850) c:\windows\COMMAND\ega.cpi) mode con codepage select=850 CAN YOU OFFER ANY MORE SUGGESTIONS???
Steven YaegerII
Ranch Hand
Joined: May 31, 2000
Posts: 182
posted
0
Here's the link that got me out of it awhile back: http://www.naviseek.com/users/rcade/books/java2412/jdkhelp6.shtml ...it is probally wise to save a copy of your original AUTOEXEC.BAT file. [This message has been edited by Steven YaegerII (edited September 21, 2000).]