Error to run Android Studio

后端 未结 17 2082
执笔经年
执笔经年 2020-12-22 17:43

I have installed Android Studio and I followed all steps described here

But when I start studio.sh I got an error with this message:

相关标签:
17条回答
  • 2020-12-22 18:17

    You have 2 things you must check:

    1. verify that /etc/environment file has the correct JAVA_HOME and PATH values referring to your Java installation directory.
    2. verify that you have the correct Java version (maybe you are using a distribution of Linux which need a server version of Java) you may need this version like my case JRE for server.
    0 讨论(0)
  • 2020-12-22 18:21
     sudo apt-get install default-jdk
    

    That's all in ubuntu 11

    0 讨论(0)
  • 2020-12-22 18:21

    On ubuntu I have tried all the methods that are described here but none worked.

    What I did in the end was to:

    • download JDK from oracle, extract the archive

    • edit android-studio/bin/studio.sh and add at the top

      export JAVA_HOME=/path/to/jdk

    • save the file and cd android-studio/bin and launch Android Studio: ./studio.sh

    0 讨论(0)
  • 2020-12-22 18:23

    Widows 7 64 bit.

    1. JAVA_HOME point to my JRE (NOT JDK) directory
    2. Coping of tools.jar from JDK\lib directory to ANDROIDSTUDIO\lib directory solve the problem
    0 讨论(0)
  • 2020-12-22 18:26

    in OpenSuSE 13.1 and some 13.2 versions you also need to:

    • install java-1_7_0-openjdk-devel package
    • change the JAVA_HOME path when starting the studio:

    For x86: JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0/ sh studio.sh

    For x64: JAVA_HOME=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/ sh studio.sh

    0 讨论(0)
  • 2020-12-22 18:28

    First check if the Java JDK is installed correctly:

    dpkg --list | grep -i jdk
    

    If not, install the JDK:

    1. Download the latest version of the JDK from Oracle: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

    2. Extract it to the appropriate location in your machine. Get the extract location:

      vi ~/.bashrc or vi ~./ bash_profile

      JAVA_HOME=/home/user/installs/jdk1.7.0_40
      PATH=$JAVA_HOME/bin
      

      source ~/.bashrc or source ~/.bash_profile

    3. After the installation you can check it:

      java -version
      which java
      

      If all things are correct then the right the answer should be something like this:

      java version "1.7.0_40"
      Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
      Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

    4. Append the following statement to studio.sh the file in android-studio/bin directory:

      JAVA_HOME=/home/user/installs/jdk1.7.0_40
      

    Finally start your Android Studio with the following command:

    ./studio.sh 
    
    0 讨论(0)
提交回复
热议问题