I am so new at this so pardon me: I downloaded the new SDK 1.4.0_1 and installed- no issue. I bought a book called learning Java 2 and I created my first .java file, a simply text display. The book tells me to edit my CLASSPATH (which I fully understand the concept) to direct it to the c:|sdk1.4..\bin folder. I did that however when I go to compile the file (for example purposes: the file is called Ellsworth.java). I am in DOS and navigate to the directory where the Ellsworth.class file is and enter the command javac Ellsworth.java I receive the error "javac is not recognized ,etc.. However, if I move the file to the bin folder where the SDK was installed and run teh command javac Ellsworth.java it works and it compiles it and creates a .class file like it should. But my probme is this, why do I have to save the .java file to the directory where the SDk is installed. Can' I have the option of saving anywhere I want and set the CLASSPATH? I am thinking the CLASSPATH is not taking somehow but if i type in SET in the DOS prompt : it shows the correcgt path. I am using Windows XP and I think there is something missing that I need to do. If anyone can help please do.. Much appreciated ~D
Actually I figured it out. I am glad that I did becuase you learn more when this like this arise. The problem was that there was another entry called PATH and it already had some directories in it so what I did is added ;c:\sdk1.4.0_01\bin to the end and it works. Looks like you need to put int he directory in 2 places. I am sure I will be back here asking some more ?'s.. ~D
posted 17 years ago
why do I have to save the .java file to the directory where the SDk is installed. You won't have to do that once everything is properly configured. It looks like you need to adjust your PATH setting. Your PATH setting simply needs to include the path to [your java SDK folder]/bin directory. Are you familiar with doing this through the control panel? If not, go to the Advanced tab in the System control panel and click on the Environment Variables. If you already have a PATH variable, then edit it to include the aforementioned directory; otherwise create a new variable named PATH with a value that includes the appropriate directory. Making sense? Any luck?