Error to run Android Studio

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

    I was facing similar problem on Windows 7 x64 professional edition. Please note following steps to fix this problem.

    1. tools.jar is missing from required path if you are using jdk1.7 x64 bit version.

    2. Please install x86 version of jdk1.7

    3. Set JDK_HOME="C:\Program Files (x86)\Java\jdk1.7.0_67" and update path environment variable as path="C:\Program Files (x86)\Java\jdk1.7.0_67\bin" Note: Linux put the proper path.

    4. Launch 32 bit application from /android-studio\bin folder.

    I tested and verified these steps on windows 7 with 32 bit jdk1.7

    0 讨论(0)
  • 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)
    
    0 讨论(0)
  • 2020-12-22 18:33

    For me, running Fedora 22 with Gnome 16.2, this solution helped me. In short, you should install the java-1.8.0-openjdk-devel, the development files of the JDK.

    Open the Terminal and search for the latest version of the JDK development package:

    $ dnf search jdk-devel
    Last metadata expiration check performed 12:44:51 ago on Mon Aug  3 22:20:24 2015.
    ============================ N/S Matched: jdk-devel ============================
    java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment
    java-1.8.0-openjdk-devel-debug.x86_64 : OpenJDK Development Environment with
                                          : full debug on
    $ sudo dnf install java-1.8.0-openjdk-devel
    
    0 讨论(0)
  • 2020-12-22 18:34

    It's probably because you don't have jdk installed in your machine. I had exact same problem in first run. Open a terminal (CTRL+ALT+T) and type: sudo apt-get install openjdk-7-jdk

    When done setup Java environment variable. Steps as follows:

    1. sudo gedit /etc/environment
    2. Either in the beginning or end of the file write: JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386 (location may vary depending on the installation of your Java)
    3. export JAVA_HOME
    4. save and exit editor.
    5. Load the path variable again using the terminal: . /etc/environment

    Couple of helpful links for further clarifications:

    • How to install JDK on Ubuntu (Linux)?

    • How to set JAVA_HOME for OpenJDK?

    Hope this helps.

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

    On Windows 7 just run the studio.bat file in your android-studio/bin folder with right click as an administrator. Now you get ask to import previous studio settings. Ignore this and on the next dialog you can specify the path to your jdk directory. That's all.

    Marcel

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