Eclipse can't find jdk installed with sdkman

て烟熏妆下的殇ゞ 提交于 2019-12-10 12:40:08

问题


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.

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.


回答1:


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



回答2:


Locate and edit your eclipse.ini file and change the line right after "-vm" to this:

/home/YOURUSER/.sdkman/candidates/java/current/bin

That should do it for Linux systems. I'm not sure about Windows or Mac tho.



来源:https://stackoverflow.com/questions/48248222/eclipse-cant-find-jdk-installed-with-sdkman

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!