Android Studio error after ./studio.sh

前端 未结 12 1186
名媛妹妹
名媛妹妹 2021-01-30 10:49

After ./studio.sh in a terminal I get this error \"tools.jar is not in android studio classpath Please ensure JAVA_HOME points to JDK rather than JRE\"

相关标签:
12条回答
  • 2021-01-30 11:08

    for openjdk: export JAVA_HOME=/usr/lib/jvm/default-java

    but you would better use the oracle jre to run android studio

    0 讨论(0)
  • 2021-01-30 11:12

    You must be sure that your jre and jdk works fine.

    Run

    $ sudo apt-get install default-jre
    

    and then...

    $ sudo apt-get install default-jdk
    

    to make sure you have your javac path run

    $ whereis javac
    

    It should return something like this:

    javac: /usr/bin/javac /usr/bin/X11/javac /usr/share/man/man1/javac.1.gz
    

    If it does not work, you can try change the JAVA_HOME in /etc/enviroment file

    Append JAVA_HOME="${/.../JVM_PATH}"

    For example:

    JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
    

    and then reload this file:

    $ source /etc/environment
    

    Source: link

    0 讨论(0)
  • 2021-01-30 11:16

    Although I have JDK installed and was pointing to it, i didn't have java-1.7.0-openjdk-devel installed (Fedora).

    0 讨论(0)
  • 2021-01-30 11:22

    Here's how I solved the same problem in my system: Thanks for @user2533809

    $sudo apt-get install openjdk-7-jdk
    $ls /usr/lib/jvm/java-1.7.0-openjdk-i386
    ASSEMBLY_EXCEPTION  bin  docs  include  jre  lib  man  THIRD_PARTY_README
    $export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-i386
    $./studio.sh 
    

    Environment :

    kesavan@kesavan-Ideapad-Z460:bin$ uname -a
    Linux kesavan-Ideapad-Z460 3.2.0-59-generic-pae #0trisquel1 SMP Sat Feb 22 03:55:17 UTC 2014 i686 i686 i386 GNU/Linux
    kesavan@kesavan-Ideapad-Z460:bin$ 
    
    0 讨论(0)
  • 2021-01-30 11:23

    I solved this by installing the jdk. This sounds annoyingly simple but I missed it. I thought I Had installed the jdk, but I had actually installed the jre.

    Wrong:

    sudo apt-get install openjdk-7-jre
    

    Right:

    sudo apt-get install openjdk-7-jdk
    

    As soon as I did that, it started up fine for me. The things we miss sometimes....

    0 讨论(0)
  • 2021-01-30 11:25

    I solved the problem combining Jerome's and Jarod's answer:

    1. Install JDK -- sudo apt-get install openjdk-7-jdk
    2. Environment Variable -- sudo nano /etc/environment adding the following line:
    3. JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-i386
    4. Reboot, and Android Studio starts up. (I had added also a link to studio.sh to the main menu).

    Also I just found https://stackoverflow.com/a/17827697/2533809 which seems to have a nice write-up, pretty much the same answer.

    (I'm using Debian 7 Wheezy)

    0 讨论(0)
提交回复
热议问题