Click to See Complete Forum and Search --> : Need to go back to Java


Steve B.
06-10-2008, 08:04 PM
Quick Java question.

I've taken Java programming before at my college, and I used to use the command "javac [filename]" to compile Java code. My home computer seems to lack this option, so I've downloaded "Java EE 5 SDK" along with numerous other options from Sun's website.

To test it, I've made a file "Simple.java" under my C:\ directory. I've gone to the command prompt and typed:
CD C:\
javac Simple.java

On the second command, I receive the error:
'JAVAC' is not recognized as internal or external command, operable program or batch file.


I've tried installing a dozen or so things, Google'd a milion times, varied the code and path parameters.. I have no idea what's going on. Could anyone help me out with why my "javac" command seems to be absent?

chazzy
06-10-2008, 09:45 PM
you need to make sure the java executables are on your PATH.

Steve B.
06-12-2008, 12:28 PM
Is it best not to work in the root directory?
Do i make a temporary directory and work from there MD C:\TEST or somesuch, determine the path to the Java app and then append it to my existing path by entering PATH=%PATH%;<the path to the Java app> ?

And if i want to make sure that I don’t mess up my original path for the session just type PATH > oldpath.bat then when I want the old path back just enter “oldpath”. Right?

In XP the path is found by right-clicking My Computer then selecting Properties/Advanced/Environment Variables.