Problems with installing Android Studio on Fedora Linux

Asked

Viewed 5,487 times

3

A few days ago I try to install the Android Studio editor on Fedora linux and I can’t.

I searched in some tutorials, websites, google and could not find a solution to deal with the error below:

ERROR: Cannot start Android Studio nno JDK found.
Please validate either STUDIO_JDK, JDK_HOME or JAVA_HOME Environment variable points to Valid JDK installation.

Any idea how to solve this problem?

  • What is the content of the environment variables STUDIO_JDK, JDK_HOME and JAVA_HOME?

4 answers

3


Open the file studio.sh and add the JAVA_HOME directly into it

UNAME=which uname

GREP=which egrep

GREP_OPTIONS=""

CUT=which cut

READLINK=which readlink

MKTEMP=which mktemp

RM=which rm

CAT=which cat

TR=which tr

JAVA_HOME=/usr/java/latest

3

For a full assessment of your problem, here are a few things you need to check to make sure you have what it takes:

Instructions for Fedora Linux

  1. Check if you have the package jdk installed:

    rpm -qa | grep jdk
    
  2. If it’s not installed, you’ll have to install:

    • Download the right package for your system from Oracle website
    • Switches to root

      sudo -i
      ## ou ##
      su -
      
    • Install the package you downloaded

      ## JDK 32-bit ##
      rpm -Uvh /caminho/para/binario/jdk-7u51-linux-i586.rpm
      
      ## JDK 64-bit ##
      rpm -Uvh /caminho/para/binario/jdk-7u51-linux-x64.rpm
      
      ## JRE 32-bit ##
      rpm -Uvh /caminho/para/binario/jre-7u51-linux-i586.rpm
      
      ## JRE 64-bit ##
      rpm -Uvh /caminho/para/binario/jre-7u51-linux-x64.rpm
      
  3. Checks the current installation:

    java -version
    

    It must give something like:

    java version "1.7.0_51"
    Java(TM) SE Runtime Environment (build 1.7.0_51)
    Java Hotspot(TM) 64-Bit Server VM (build 22.1, Mixed mode)

  4. Checks which compiler:

     javac -version
    

    It must give something like:

    javac 1.7.0_51

  5. Adds JAVA_HOME the environment variable:

    The most common is to edit the file .bashrc on your user directory:

    gedit ~/.bashrc
    

    And add to the end of it:

    JAVA_HOME=/usr/lib/jvm/java-<versão>
    

    Note: After this it may be necessary to re-log in for all changes to be taken over.


Original response

Your problem usually in its most common form is a matter of permissions.

Try changing the folder permissions:

chown -R root:root /caminho/para/android-studio

Credit of the solution to this answer from SOEN given by @nikodroid.

  • I couldn’t, I tried the way you put it and nothing!

  • Have you set the right path for the android-studio folder? And by the way, you set the JAVA environment variable? assuming you installed it :)

  • Yes, I put yes and nothing my brother.

  • @Faro I put more detailed instructions so you can confirm the various details.

  • Man, the java is showing more... after I put the alternatives and the eclipse no longer wants to open, what I do...

1

Dude I broke my head but I got on Win7 that was with the same problem, computer>property_do_system>variables>de_environment> Then I had to create a new New=> variable name: JAVA_HOME variable value: C: Programdata Oracle Java javapath;C: Program Files Java jdk1.8.0_11 This "variable value" is the same as the "PATH" variable found on the same variable screen is only put into edit and copy this field. I hope in the end

  • 1

    The question is how to do this on Linux, not Windows :/

0

Do the following:

1) Install JDK, Download Here

2) See the installation directory. To do this open the console and write the following command:

rpm -q -filesbypkg jdk

In my case it was /usr/java/jdk1.8.0_11/.

3) Open the file studio.sh and add the line JAVA_HOME

UNAME=which uname
GREP=which egrep
GREP_OPTIONS=""
CUT=which cut
READLINK=which readlink
MKTEMP=which mktemp
RM=which rm
CAT=which cat
TR=which tr
JAVA_HOME=/usr/java/(seu directório, no meu caso jdk1.8.0_11)

4) Save the file. Done!

Browser other questions tagged

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