本文介绍了Eclipse找不到使用sdkman安装的jdk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是sdkman的新手,但是我设法安装了它并安装了一些软件:JDK,Gradle和其他一些软件。问题是,在我下载了Eclipse并尝试运行它之后,它只是找不到JDK。我已经导出了JAVA_HOME和PATH。实际上,我实际上可以从终端运行java,javac和其他Java命令,甚至尝试使用update-alternatives。我已经更改了eclipse文件夹的所有权,但没有结果,Eclipse无法找到JDK。

Im new with sdkman, but I managed to install it and install some software with it: JDK, Gradle and a few others. The problem is that after I downloaded Eclipse and tried to run it, it just simply can't find the JDK. I have already exported JAVA_HOME, and PATH. In fact, I can actually run java, javac and other Java commands from the terminal, I even tried with update-alternatives. I have changed the ownership of the eclipse folder with no results, Eclipse cannot find the JDK.

我必须使用apt-get安装Java,这使得eclipse可以工作,但是什么使用sdkman?所以我的问题是:我缺少使Eclipse使用sdkman java安装的配置。

I had to install java with apt-get and that makes eclipse work, but whats the of using sdkman? So my question is: What configuration am I missing to make Eclipse use the sdkman java installation.

推荐答案

我遇到了同样的问题,通过在 / usr / bin 中为Java和javac创建符号链接来解决该问题。

I faced the same issue and resolved it by creating a symbolic link in /usr/bin for both java and javac.

sudo ln -s ~/.sdkman/candidates/java/current/bin/javac /usr/bin/javac
sudo ln -s ~/.sdkman/candidates/java/current/bin/java /usr/bin/java

我通过执行操作获得了这些位置

I got these locations by doing

which javac
which java

这篇关于Eclipse找不到使用sdkman安装的jdk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 03:03