Error to run Android Studio

后端 未结 17 2080
执笔经年
执笔经年 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:10

    The error is self explanatory, you need to set your environment variable to JDK path instead of JRE here is it

    JDK_HOME: C:\Program Files\Java\jdk1.7.0_07
    

    check the path for linux

    and here is possible duplicate Android Studio not working

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

    Check if your Java JDK is installed correctly

    dpkg --list | grep -i jdk
    

    If not, install JDK

    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update && sudo apt-get install oracle-java8-installer
    

    After the installation you have to enable the jdk

    update-alternatives --display java
    

    Check if Ubuntu uses Java JDK 8

    java -version
    

    If all went right the answer should be something like this:

    java version "1.8.0_91"
    Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
    Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
    

    Check what compiler is used

    javac -version
    

    It should show something like this

    javac 1.8.0_91
    

    Finally, add JAVA_HOME to the environment variable

    Edit /etc/environment and add JAVA_HOME=/usr/lib/jvm/java-8-oracle to the end of the file

    sudo nano /etc/environment
    

    Append to the end of the file

    JAVA_HOME=/usr/lib/jvm/java-8-oracle
    

    You will then have to reboot, you can do this from the terminal with:

    sudo reboot
    

    In case you want to remove the JDK

    sudo apt-get remove oracle-java8-installer
    
    0 讨论(0)
  • 2020-12-22 18:12

    The problem is a bug on Fedora 20. The bug is very odd: if I have Google Talk plugin installed then Eclipse crashes (https://bugs.eclipse.org/bugs/show_bug.cgi?id=334466). It's crazy for me. I thought that was Java version and with Java 6 my eclipse was still crashing. To solve this I should use gnome/GTK instead KDE. Now it works "well" (in gnome environment). Thanks for all answers.

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

    I ran into this issue when I was referencing

     [drive]:\Program Files\Java\jdk1.8.0_65 
    

    in my JAVA_HOME environment var instead of the Android Studio recommended

    [drive]:\Program Files\Java\jdk1.7.0_79. 
    

    I am using the x64 version of the JDK on Windows 10 Pro.

    From the Android Studio installation instructions.

    Before you set up Android Studio, be sure you have installed JDK 6 or higher (the JRE alone is not sufficient)—JDK 7 is required when developing for Android 5.0 and higher. To check if you have JDK installed (and which version), open a terminal and type javac -version. If the JDK is not available or the version is lower than version 6, download the Java SE Development Kit 7

    http://developer.android.com/sdk/installing/index.html?pkg=studio

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

    This is caused by having JAVA JRE installed as opposed to JAVA JDK.

    The solution is simple:

    sudo apt-get install openjdk-7-jdk
    

    http://www.maxmakedesign.co.uk/development/2013/android-studio-tools-jar-classpath/

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

    I had the same problem on a new installed Linux Mint 16. To fix this you just need to type command

    sudo apt-get install openjdk-7-jdk
    

    And that's it. You even do not need to add repositiries or creating JAVA_HOME in your environment.

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