can't run javac directly from command prompt
Hi, I use Win Vista and every time I try to compile X.java via javac X.java command via command prompt I get 'javac' is not recognized then I have to go to " C:\Program Files\Java\jdk1.6.0_05\bin" and from there type javac X.java to work, what should I do to make the javac work every where?
thanks
Re: can't run javac directly from command prompt
The OS can not find the javac.exe command. You either need to add the path to the javac.exe file to the PATH environment variable or you need to use the full path to the compiler when you try to execute it.
Re: can't run javac directly from command prompt
Quote:
Originally Posted by
Norm
The OS can not find the javac.exe command. You either need to add the path to the javac.exe file to the PATH environment variable or you need to use the full path to the compiler when you try to execute it.
thanks it worked :)
Re: can't run javac directly from command prompt
I'm still having trouble with the same issue. I'm running on windows Vista, and even though I have all that in my environmental variables, I'm still getting the message about javac not being a command. When I input it as an environmental variable it asks for name and value, do I need a specific name for the variable? I'm certain my path(value) is correct (C:\Program Files\Java\jdk1.6.0_11\bin). Can anyone help?
Re: can't run javac directly from command prompt
Have you logged off/logged back on? Windows won't update the environment variables when you're logged in.
Re: can't run javac directly from command prompt
hmmm Ii just tried logging out and even restarting my computer and i still cant get it to work. hmmm
how do you have it written in your environmental variables? Maybe I've done something wrong there.
Re: can't run javac directly from command prompt
Show us what you have: Open a command prompt window, enter: Path, copy and paste the contents of the window here showing what your settings are.
Here are mine:
Quote:
E:\Realtime>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Sys tem32\Wbem;C:\Perl\bin;C:\Prog
ram Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft
Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common
\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;D:\Java\jdk1.6.0_02\bin
\;C:\BatchFiles\;C:\Program Files\Common Files\Nero\Lib\
Re: can't run javac directly from command prompt
I'm sorry, now I feel like an idiot. I had understood the instructions wrong, instead of editing the "Path" variable i was trying to make a new variable. It works just fine now, thanks for all your time and patience with me. Thanks all of you :o