1

Alright, I'm trying to access Java SDK tools such as JavaC through CMD but I can't.

Here is my echo %path% C:\Users\msivri>echo %PATH%

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Wind owsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static; c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\; c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Mic rosoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\10 0\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows K its\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\T ools\Binn\;

Here is what my PATH system variable contains:

C:\Program Files\Java\jdk1.7.0_40\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;

Notice that they are both different for some reason...

2
  • Did you modify your PATH via the Windows UI? If so, only cmd prompts opened after you modified it will have the changes . . . note that it's also a good idea to put more specific paths at the end, rather than the beginning as PATH will be searched in order . . .
    – ernie
    Commented Sep 18, 2013 at 18:39
  • Yup, that's right. Thanks, I didn't know that.
    – user255447
    Commented Sep 18, 2013 at 18:40

1 Answer 1

0

It sounds as if you modified the system variable via Windows, and already had a command prompt open.

Note that changes you make to the system/environment variables will not be applied to already open cmd.exe prompts, but will be applied to all new instances.

As an aside, it's also a good idea to put more specific paths at the end, rather than the beginning of PATH, when you type a command at the prompt, the search order is first check the current working directory, then each of the items in path in order. So with the paths as shown above, if you type "notepad.exe", it'll first check your current working directory, then the Java bin directory, then finally your C:\Windows\System32 directory. So, in general, each command you type now will be just a little bit slower as it'll check the Java bin dir first for the command . . .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .