Problems installing Android Studio on Linux Fedora

3

A few days ago I tried to install the Android Studio editor on Fedora linux and I can not.

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

  

ERROR: Can not start Android Studio \ nNo JDK found.
  Please validate either STUDIO_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.

Any ideas how to solve this problem?

    
asked by anonymous 20.02.2014 / 22:05

4 answers

3

Open the file studio.sh and add JAVA_HOME directly to 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

    
16.04.2014 / 17:02
3

For a complete evaluation of your problem, here are some things you need to check to make sure you have what it takes:

Instructions for Fedora Linux

  • Verify that you have the jdk package installed:

       
    rpm -qa | grep jdk
    
  • If it is not installed, you will have to install it:

    • Download the appropriate package for your system from the Oracle site >
    • Switch 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
      
  • Check the current installation:

       
    java -version
    

    It should look something like this:

      

    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)

  • Check which compiler:

       
     javac -version
    

    It should look something like this:

      

    javac 1.7.0_51

  • Adds JAVA_HOME to the environment variable:

    Most common is to edit the .bashrc file in your user directory:

       
    gedit ~/.bashrc
    

    And add to the end of it:

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

    Note: After this you may need to re-log in for the changes to be made.

  • Original answer

    Your problem is usually in the form of a permissions issue.

    Try changing the permissions of the folder:

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

    Solution credit for SOINC given by @nikodroid

    >     
    20.02.2014 / 22:19
    1

    Dude I broke my head but I got it in win7 that had the same problem, the solution was computer > system_name > environment_variables > Then I had to create a new one in New =>  variable name: JAVA_HOME  value of the variable: C: \ ProgramData \ Oracle \ Java \ javapath; C: \ Program Files \ Java \ jdk1.8.0_11 This "value of variable" is the same as the variable "PATH" found on the same screen of variables just put in edit and copy that field. I hope in order to resolve it

        
    18.11.2014 / 14:06
    0

    Do the following:

    1) Install JDK, Download Here

    2) View the installation directory. To do this open the console and type 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!

        
    05.08.2014 / 21:53