[英]“Cause: error=2, No such file or directory” when trying to import project from VCS - Java Home issue on Linux
I'm trying to import a project into Intellij using Solus and I'm having a bit of an issue with Gradle being able to find the correct Java location. 我正在尝试使用Solus将项目导入Intellij,并且Gradle能够找到正确的Java位置时遇到了一个问题。 I get this error when I try to sync:
尝试同步时出现此错误:
Cause: error=2, No such file or directory
原因:错误= 2,没有这样的文件或目录
Which, when going through Intellij's logs, is caused by this: 在查看Intellij的日志时,这是由以下原因引起的:
Caused by: java.io.IOException: Cannot run program "/opt/jdk1.8.0_221/bin/java" (in directory "/home/me"): error=2, No such file or directory
由以下原因引起:java.io.IOException:无法运行程序“ /opt/jdk1.8.0_221/bin/java”(在目录“ / home / me”中):error = 2,没有这样的文件或目录
For some reason Gradle is looking in my home directory for my $JAVA_HOME location, and I have no idea why or how to point it to the right destination. 由于某种原因,Gradle在我的主目录中查找我的$ JAVA_HOME位置,而我不知道为什么或如何将其指向正确的目的地。 I have a symlink between
/opt/jdk1.8.0_221
and usr/bin/java
, and when I run echo $JAVA_HOME
I get this output: 我在
/opt/jdk1.8.0_221
和usr/bin/java
之间/opt/jdk1.8.0_221
了符号链接,当我运行echo $JAVA_HOME
,得到以下输出:
~ $ echo $JAVA_HOME
/usr/bin/java
Is there something I'm doing incorrectly with setting up Java on Solus? 我在Solus上设置Java是否做错了什么? Or am I missing some Gradle setting?
还是我缺少某些Gradle设置?
Not a true solution, but I just ended up reinstalling Solus and using SDKMan for managing my java installs. 这不是一个真正的解决方案,但最终我只是重新安装了Solus并使用SDKMan来管理我的Java安装。 Everything is okay now!
现在一切都很好!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.