简体   繁体   English

无法在IntelliJ中运行主要方法

[英]Unable to run main method in IntelliJ

When attempting to run the main method in IntelliJ I get the following error: 尝试在IntelliJ中运行main方法时,出现以下错误:

Error:Cannot run program "C:\\Program Files (x86)\\Java\\jdk1.8.0_121\\bin\\java" (in directory "C:\\Users\\MyName\\.IntelliJIdea2016.3\\system\\compile-server"): CreateProcess error=2, The system cannot find the file specified

I'm not entirely sure what to do here, because I do have a JDK installed on my machine. 我不确定在这里做什么,因为我的机器上确实安装了JDK。

sometimes you have to do the JDK path go to the JDK directory in program files then go to bin folder copy the directory adress then. 有时您必须执行JDK路径,然后转到程序文件中的JDK目录,然后转到bin文件夹,然后复制目录地址。
go to computer right click on it then property go to advance setting then click on environment variables then choose path then edit it at the last of the sentence of path enter ; 在电脑上右击它,然后属性进入预先设置,然后点击环境变量然后选择路径,然后在输入路径的最后一行进行编辑; then paste the path we copied 然后粘贴我们复制的路径

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

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