Error to run Android Studio

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

    On my Linux Mint 17.3 install, I found these instructions incredibly helpful.

    The problem seems to boil down to the system's default Java being OpenJDK and Android Studio preferring Oracle's JDK. I actually did not perform the OpenJDK removal steps given in the tutorial, but only downloaded the Oracle JDK and set it as my system's default. Android Studio worked right away.

    In case the linked page ever goes away, the steps I took were

    Download Oracle JDK. Mine was version 1.7.0_79.

    tar -zxvf jdk-7u79-linux-x64.tar.gz
    sudo mkdir -p /opt/java
    sudo mv jdk1.7.0_79 /opt/java
    sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.7.0_79/bin/java" 1
    sudo update-alternatives --set java /opt/java/jdk1.7.0_25/bin/java
    

    and

    java -version
    

    confirms the system is using Oracle's JDK, giving output like

    java version "1.7.0_79"
    Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
    Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
    

提交回复
热议问题