Intellij doesn't see JDK in Linux Mint
已回答
I installed IntelliJ 2019.1 on Linux Mint and it doesn't recognize the JDK. I'm used to it automatically detecting it.
I have tried:
- Manually adding the JDK and selecting
/usr/bin/javabut it doesn't see anything within/bin/. - Manually adding the JDK and selecting
/usr/lib/jvm/but it doesn't see the/jvm/directory. - Removing intellij, purging all traces of java from my system, reinstalling openjdk 8 using apt, restarting then reinstalling intellij
- Tried following the steps here but the repo was taken down on the 16th of April
I need to specifically use version 8, preferably openjdk not oracle (existing project with other team members who would like us all using the JDK)
java -version returns
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
whereis java returns
java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz
echo $JAVA_HOME returns nothing.
请先登录再写评论。
IntelliJ IDEA needs the directory where your JDK is installed, not the directory where the binary is linked. It expects the standard layout of the JDK directory with lib, jre, bin subdirectories.
You can download and unpack it manually from OpenJDK site or from Oracle site. It's also available at https://bintray.com/jetbrains/intellij-jbr (the same as used to run IntelliJ IDEA itself).
This is most likely a problem in Mint. It's exactly the same on my machine. I have installed `openjdk-8-jdk` from the Mint software repositories using `apt install` and the directory `/usr/lib/jvm/java-8-openjdk-amd64` is a valid JDK directory. However, IntelliJ Idea can not find the directory at all. Manually pointing to it when says: 'Specified path can not be found.'
It is a bug. When you install the IDE using the software center.
When you installing IDE using the software center you installing a flatpack version of IDE.
flatpack has own restrictions to use the file system.
/lib,/lib32,/lib64,/bin,/sbin,/usr,/boot,/root,/tmp,/etc,/app,/run,/proc,/sys,/dev,/var/run/media/var/run/host:/etc,/usrSo you have to use path something like /var/run/host/usr/lib/jvm/java-1.8.0-openjdk-amd64
Thanks Isukhorutchenko for that hint. I also had many issues with a PHP dev environment. Like that the terminal (bash) was not knowing commands like composer, the composer integration itself didn't work, as well as I couldn't even integrate the PHP binary.
So, I removed the Installation from the Software Manager and installed the IDE via the JetBrains Toolbox and NOT using their version through snap since it doesn't integrate that nicely to the desktop with colored icons and so on ;)
Thanks!