简体   繁体   English

Intellij 错误=2 没有那个文件或目录

[英]Intellij error=2 No such file or directory

Installed intellij and added sdk path to project structure, but when i try to run i get:安装了 intellij 并为项目结构添加了 sdk 路径,但是当我尝试运行时,我得到:

Error: Cannot run program "/home/$USER/java/jdk1.8.0_121/bin/java" 
(in directory"/home/$USER/.intelliJIdea2016.3/system/compile-server"):
error=2, No such file or directory

Both files (/home/$USER/java/jdk1.8.0_121/bin/java and /home/$USER/.intelliJIdea2016.3/system/compile-server) exists.两个文件(/home/$USER/java/jdk1.8.0_121/bin/java 和/home/$USER/.intelliJIdea2016.3/system/compile-server)都存在。

I am using Ubuntu 16.10我正在使用 Ubuntu 16.10

The answer from here Change jdk path in IntelliJ 13 when compiling from 32 bit program file folder to 64 bit one worked for me 这里的答案当从32位程序文件夹编译为64位时,更改IntelliJ 13中的jdk路径

From the menu: File -> Project Structure... . 从菜单: File - > Project Structure...

On the left, below "Platform Settings", you have "SDKs": click on it; 在“平台设置”下方的左侧,您有“SDK”:点击它; you can add your new JDK here. 你可以在这里添加你的新JDK。

Always in the same window, below "Project Settings", select "Project": you have the option to select the JDK which you just added. 始终在同一窗口中,在“项目设置”下,选择“项目”:您可以选择刚刚添加的JDK。

Make sure your JDK path is correct. 确保您的JDK路径正确。 In my case, it updated JDK version somehow but I didn't notice it, there are a lot of red underlines. 在我的情况下,它以某种方式更新了JDK版本,但我没有注意到它,有很多红色下划线。 After I edit JDK with the correct path, the world became green. 在用正确的路径编辑JDK之后,世界变得绿色。

In my case, IntelliJ was pointing to a JDK folder of a version I had uninstalled. 在我的例子中,IntelliJ指向我卸载的版本的JDK文件夹。 For some reason the uninstaller didnt remove the Java/jdk* folder, so it was not showing any error in the configuration screen File -> Project Structure -> SDK 出于某种原因,卸载程序没有删除Java / jdk *文件夹,因此在配置屏幕文件 - >项目结构 - > SDK中没有显示任何错误

After finding out it was pointing to an uninstalled JDK folder then I proceeded to adjust this configuration thanks to the answer posted by UberHans 在发现它指向一个已卸载的JDK文件夹后,由于UberHans发布的答案,我继续调整此配置

1-see your version system, is window, mac or linux? 1-看你的系统版本,是window、mac还是linux?

2-dowload specifc jdk(mac, window, linux). 2-下载特定的 jdk(mac、window、linux)。

3-Cheked your folders and file requered and path jdk/bin/(exec java) 3-检查你的文件夹和文件requered和路径jdk/bin/(exec java)

4-see if the execut file java is compatibile your, system in your folder bin 4-查看执行文件java是否与您的文件夹bin中的系统兼容

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

相关问题 Intellij中的目录错误 - Directory error in Intellij Intellij:MapReduce 错误:线程“main”0 中的异常:没有这样的文件或目录 - Intellij : MapReduce error : Exception in thread "main" 0: No such file or directory Intellij 无法解析文件/目录 - Intellij Cannot Resolve file/directory IntelliJ IDEA文件FileNotFoundException,目录和文件是否存在? - IntelliJ IDEA File FileNotFoundException, directory and file exists? 如何在bin目录的Intellij中更新.class文件? - How to update .class file in Intellij in bin directory? 使用文件阅读器时,Intellij 中没有这样的文件或目录 - No such file or directory in Intellij while working with filereader IntelliJ docker 部署添加:没有这样的文件或目录 - IntelliJ docker deployment ADD: no such file or directory 如何在 Intellij 调试器中查看文件的目录? - How to see the directory of a file in Intellij debugger? Intellij 社区版中的 Azure function 应用程序无法验证 function 运行时:无法运行程序“java”:错误=2,没有这样的文件 - Azure function app in Intellij Community Edition Failed to validate function runtime: Cannot run program “java”: error=2, No such file or directory 在mac上没有这样的文件或目录错误 - No such file or directory error on a mac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM