Error while running studio.sh

Asked

Viewed 399 times

0

Hello, I’m new in development with Java.

I’m using Fedora 26 and openjdk java version "1.8.0_91".

my environment variables are:

export JAVA_HOME=/usr/lib/java
export CLASSPATH=$JAVA_HOME/lib/
export MANPATH=$JAVA_HOME/man
export STUDIO_JDK=/opt/android-studio/bin/
export PATH=$PATH:$JAVA_HOME/bin/:$CLASSPATH:$STUDIO_JDK

when running studio.sh gives the following error

JDK Required: 'tools.jar' seems to be not in Studio classpath. Please ensure JAVA_HOME points to JDK rather than JRE.

something missing to run android studio for linux?

1 answer

1

Make sure your JDK is actually installed correctly with

dpkg --list | grep -i jdk

If not, reinstall. Then enable your JDK:

update-alternatives --display java

Check out the version installed with:

java -version

If it’s all right, the return will be something like this:

java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

Then check the compiler with:

javac -version

If it’s all right, the return will be something like this:

javac 1.8.0_91

Finally, add JAVA_HOME to his $PATH Edit your /etc/environment and add JAVA_HOME=/usr/lib/jvm/java-8-oracle (or compatible with the Java you downloaded) at the end of the file.

You will have to restart your machine after editing $PATH, can be done by the same terminal, with:

sudo reboot

Browser other questions tagged

You are not signed in. Login or sign up in order to post.