简体   繁体   English

Windows 7 cmd.exe可以运行java命令,但是找不到Intellij终端Java命令并且出错

[英]Windows 7 cmd.exe can run java command ,but Intellij terminal Java command not found and error

Using Intellij IDE 15, I can't run java command, and Intellij IDE Terminal report that java is not recognized as an internal or external command. 使用Intellij IDE 15,我无法运行java命令,并且Intellij IDE Terminal报告java未被识别为内部或外部命令。 I'm confused why windows 7 CMD terminal can run normally? 我很困惑为什么Windows 7 CMD终端可以正常运行? Intellij IDE can't do this. Intellij IDE无法做到这一点。

Run command echo %Path% in the terminal and check that jdk bin folder is shown in command output. 在终端中运行命令echo %Path% ,并检查命令输出中是否显示了jdk bin文件夹。 If it is not show then add %JAVA_HOME%\\bin\\ to the system environment Path and restart Intellij IDE or just restart Intellij IDE if Path variable contains necessary path. 如果未显示,则将%JAVA_HOME%\\ bin \\添加到系统环境Path并重新启动Intellij IDE,或者只在Path变量包含必要路径时重新启动Intellij IDE。

In the terminal, are you in the jdk/bin folder before doing the command? 在终端中,您在执行命令之前是否在jdk / bin文件夹中?

Check if $JAVA_HOME is set on the environment variables, also check if you have the correct path to the jdk in Intellij. 检查是否在环境变量上设置了$ JAVA_HOME,还要检查是否在Intellij中有正确的jdk路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM