Reputation: 2051
I looked over to a lot of answers here on SO, and followed them too, yet the error persists and I cannot start the Intellij
for java.
Here is my java
version
openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)
my javac
version
javac 9-internal
my $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64
When I cd
into <ide_folder>/bin
and run ./idea.sh
I get following error
JDK Required: 'tools.jar' seems to be not in IDEA classpath.
Please ensure JAVA_HOME points to `JDK` rather than `JRE`.
and when I do sudo ./idea.sh
I get following error
WARN: Unknown class loader: jdk.internal.loader.ClassLoaders$AppClassLoader
WARN: Unknown class loader: jdk.internal.loader.ClassLoaders$PlatformClassLoader
WARN: Unknown class loader: jdk.internal.loader.ClassLoaders$AppClassLoader
WARN: Unknown class loader: jdk.internal.loader.ClassLoaders$PlatformClassLoader
JDK Required: 'tools.jar' seems to be not in IDEA classpath.
Please ensure JAVA_HOME points to JDK rather than JRE.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f5624a1e009, pid=15159, tid=15182
#
# JRE version: OpenJDK Runtime Environment (9.0) (build 9-internal+0-2016-04-14-195246.buildd.src)
# Java VM: OpenJDK 64-Bit Server VM (9-internal+0-2016-04-14-195246.buildd.src, mixed mode, tiered, compressed oops, concurrent mark sweep gc, linux-amd64)
# Problematic frame:
# C [libjava.so+0x1d009] JNU_GetEnv+0x19
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %P" (or dumping to /home/ekbana/softwares/idea-IC-171.4694.23/bin/core.15159)
#
# An error report file with more information is saved as:
# /home/ekbana/java_error_in_IDEA_15159.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted (core dumped)
I have reached the point where I have no freaking idea what's happening.
Upvotes: 3
Views: 11837
Reputation: 11
Follow these five simple and easy steps. It should work:
Download JDK from Oracle website according to your operating system. Extract and keep it ready in a folder.
Go to the Java Installed folder: You can find the folder by typing which java and just consider the path before JRE.
Java Installed Folder Example: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el6_10.x86_64/jre/bin/java
Consider: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el6_10.x86_64/
Create the following directory after the considered path(for jdk)
sudo mkdir /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el6_10.x86_64/jdk
Your extracted jdk should be similar to this:
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el6_10.x86_64/jdk/jdk1.8.0_221
Example: /home/cloudera/intellij/idea-IC-192.6817.14/bin/idea.sh
Search for this line: JAVA_BIN="$JDK/bin/java" You can search the file by opening the file using vi and then press escape and then / and then paste JAVA_BIN="$JDK/bin/java". Add the JDK path that we just created on top of this line:
Example: JDK=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el6_10.x86_64/jdk/jdk1.8.0_221
sh /home/cloudera/intellij/idea-IC-192.6817.14/bin/idea.sh
Basically, we are providing a JDK reference for IntelliJ.
Upvotes: 1
Reputation: 4077
For lazy like me using this on Fedora, I just needed to find the good module for java (opendjdk with jdk) then export the vairable
sudo dnf install java-1.8.0-openjdk-devel
export JDK=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-8.fc29.x86_64
Upvotes: 0
Reputation: 1
I was facing a similar problem, I'm not using Oracle JDK and using OpenJDK-8 instead on Debian Stretch, tried to find the JDK tooling and couldn't find it, however eclipse and maven are working correctly. I just installed the default-jdk for Debian and it solved the issue with IntelliJ IDEA with the following command
sudo apt-get install default-jdk
Upvotes: 0
Reputation: 1
I finally solve this problem that was getting me crazy.
First of all you have to be sure that you had download the JDK for linux from the webpage of oracle. Oracle JDK download
Next you had to go to the path wher you install intellij: idea-IC-173.4548.28/bin/
There you have two ways of modify the file idea.sh, throw terminal or an text deditor. In my case teminal:
nano idea.sh
There you need to declare the path where you leave(install JDK) This can be:
The way you declare is below were it's says:
#Locate a JDK installation dierctory which will be used to run the IDE.
#Try (in order): IDEA_JDK, idea.jdk, ./jre64, JDK_HOME, JAVA_HOME, "java" in PATH
#------------------------------------------------------------------------------
You insert:
JAVA_HOME="/home/programs/jdk1.8.0_162"
Save.
Next we have to copy paste the tool.jar from the path /home/programs/jdk1.8.0_162/lib to the path /home/programs/jdk1.8.0_162/bin
Finally we return to the terminal to:
cd /home/programs/jdk1.8.0_162/bin
./idea.sh
And it's should work.
Upvotes: 0
Reputation: 1071
in my case, I needed to run both following commands :
sudo apt-get install openjdk-8-jre
sudo apt-get install openjdk-8-jdk
Upvotes: 5
Reputation: 11018
those who are tired of looking for solutions. for linux users
incred@incred-Latitude-3560:~$ whereis java
/home/incred/development/android-studio/jre/bin/java
becomes
/home/incred/development/android-studio/jre
cd idea-IC-172.3968.16/bin/
open the idea.sh file using your desired editor and look for this line in find tool. JAVA_BIN="$JDK/bin/java" paste the java location from previous to one line above the found one.
JDK="/home/incred/development/android-studio/jre"
JAVA_BIN="$JDK/bin/java"
save it and execute your idea.sh from terminal. in short just try to update the location of your java installation in idea.sh file or similar for windows users.
Upvotes: 2
Reputation: 221
Make sure you have a JDK installed on your system.
sudo apt-get install openjdk-7-jdk
If that does not solve your problem, you must tell your system to use that JDK instead of the current JRE. To do so, you choose which JDK/JRE you use by default on your system by executing the following command in terminal.
sudo update-alternatives --config java
This command will give you a list of alternative java options, which you will then be able select a JDK instead of JRE.
Upvotes: 2