当“在此处打开命令窗口”时,JavaC未初始化

时间:2019-02-21 08:18:09

标签: java batch-file cmd command-line javac

当我尝试 shift +右键单击文件夹窗口,然后单击:Open command window here时,它会弹出一个已经cd到路径的命令窗口,像平常一样。我确实安装了JavaC,并且可以使用javac从命令行运行它,但是从Open command window here打开cmd窗口,然后键入javac,它说:

'javac' is not recognized as an internal or external command,
operable program or batch file.

,但通常显示帮助,没有Open command window here

This is the context menu with <code>Open command window here</code> by _shift_+right-clicking

我的path变量是:C:\Windows\system32;C:\Windows;C:\Program Files\------;C:\Program Files\Java;C:\Program Files\Java\jdk-11.0.2;C:\Program Files\Java\jre1.8.0_201;C:\Windows\system32;C:\Windows;C:\Program Files\CCleaner;C:\Program Files\Java;C:\Program Files\Java\jdk-11.0.2;C:\Program Files\Java\jre1.8.0_201;C:\Program Files\Java\jdk-11.0.2\bin;C:\Program Files\Java\jre1.8.0_201\bin

Java和JavaC的路径在path变量中。

This is my cmd window, but it's not much because it doesn't show the full path because of the window size

也许这会有所帮助?:

Maybe this will help?

2 个答案:

答案 0 :(得分:1)

您需要确保它在Path环境变量中。对其进行编辑(例如,在Windows 10中,转到“高级系统设置”->“环境变量”,选择“路径”并进行编辑),并确保其中包含类似C:\Program Files\Java\jdk1.8.0_192\bin的内容。

答案 1 :(得分:0)

是的! 我终于明白了!您会看到“此处打开命令窗口”选项的注册表屏幕截图,< strong> command 键的 (Default) 字符串是cmd.exe /s /k pushd "%V",我删除了/s部分,所以它是cmd.exe /k pushd "%V",然后我重新启动PC。