[英]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.