For some reason I cant get my machine to compile from the command line using javac filename.java. I get a message that 'javac' is not recognized as an internal or external command. I have installed VC4 Expert Edition and I downloaded Java VM and J2se 1.4.2 SDK. How can I use javac???
Hi Amri, Welcome to JavaRanch! The j2sdk1.4.2/bin directory has to be named on your PATH environment variable. The precise details of setting your PATH depend on the OS, and aren't specific to Java; if you don't know how, see your OS documentation.
Hi Amri and welcome to the Ranch. If you are on Win2k/XP then here is how: 1) Right-click on 'My Computer', then goto 'Properties'. 2) Under 'Advanced' tab, click on 'Environment Variables'. 3) Double click on the 'Path' variable (Under System variables). 4) Add the path in which the java compiler is located. In my case i added D:\j2sdk1.4.2\bin 5) Here is how my 'path' variable looks like %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;D:\j2sdk1.4.2\bin If you are on a different platform (Linux for example) then that would be another story. Hope this helps.
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. <br />- What truth? <br />- That there is no spoon!!!
I would recommend adding a new variable called JAVA_HOME and set the value of this variable as d:\j2sdk1.4.2 (or whatever your drive is) and then in the classpath change d:\j2sdk1.4.2\bin to %JAVA_HOME%\bin - This would help when it comes to changing the J2SDK version you are using and you will only need to update the JAVA_HOME variable. HTH
The secret to creativity is knowing how to hide your sources.