Ubuntu下安装Android Studio
Ubuntu下安装Android Studio
mickelfeng 发表于4年前
Ubuntu下安装Android Studio
  • 发表于 4年前
  • 阅读 113
  • 收藏 0
  • 点赞 0
  • 评论 2

腾讯云 技术升级10大核心产品年终让利>>>   

我电脑的环境是Ubuntu 12.04 64位。

Android Studio下载地址:https://developer.android.com/sdk/installing/studio.html#download

看下各个环境的说明
360截图20130517040715932.jpg

下面开始安装
Ctrl+Alt+T打开terminal,进行解压:

tar xzvf ~/Downloads/android-studio-bundle-130.677228-linux.tgz
sudo mv android-studio /opt/



然后开始安装:

cd android-studio/bin/ ./studio.sh


可能会跑出来这句话:

OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu2) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) WARNING: You are launching the IDE using OpenJDK Java runtime.

         ITS KNOWN TO HAVE PERFORMANCE AND GRAPHICS ISSUES! SWITCH TO THE ORACLE(SUN) JDK BEFORE REPORTING PROBLEMS! NOTE:    If you have both Oracle (Sun) JDK and OpenJDK installed
         please validate either STUDIO_JDK, JDK_HOME, or JAVA_HOME environment variable points to valid Oracle (Sun) JDK installation.
         See http://ow.ly/6TuKQ for more info on switching default JDK.

Press Enter to continue.


我电脑上装得是Ubuntu自带的OpenJDK,可能会出现一些错误或者警告什么的,于是我重新装了一遍JDK。

http://www.oracle.com/technetwork/java/javase/downloads/index.html
下载JDK,我下的是最新版的jdk-7u21-linux-x64.tar.gz(64位),建议下载1.6版本的,最新的不怎么稳定。网上有很多安装的方法(比如,
http://forum.ubuntu.org.cn/viewtopic.php?t=183803,
http://blog.csdn.net/yang_hui1986527/article/details/6677450,
http://www.cnblogs.com/shaoguobao/archive/2011/07/16/2108015.html )

然后解压、配置环境变量:

tar xzvf ~/Downloads/jdk-7u21-linux-x64.tar.gz
sudo mv jdk1.7.0_21/ /usr/lib/jvm/
sudo vi /etc/environment
PATH="......:/usr/lib/jvm/jdk1.7.0_21:/opt/android-studio/bin/" CLASSPATH=.:/usr/lib/jvm/jdk1.7.0_21 JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21 source ~/.bashrc
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_21/bin/java 300 sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_21/bin/javac 300 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0_21/bin/javaws 300 sudo update-alternatives --config java
sudo update-alternatives --config javaws



用java -version测试下安装是否成功:

java -version java version "1.7.0_21" Java(TM) SE Runtime Environment (build 1.7.0_21-b11) Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)



如果你装的是64位的Ubuntu还要继续输入:

apt-get install lib32ncurses5 ia32-libs


最后再重新试一遍:

studio.sh


Android_Studio.jpg

Android_Studio_Gradle_Download.jpg

Android_Studio_New_Project.jpg

Android_Studio_Project_Java.jpg
OK,成功!

熟悉下流程:
360截图20130517040948819.jpg

共有 人打赏支持
mickelfeng
粉丝 214
博文 904
码字总数 506377
评论 (2)
余泽锋1987
博主,我(菜鸟一只)遇到一个问题,凭有限的能力在网上找不到答案,希望大神能都帮忙:新建工程报错,android studio(版本0.8.0)
[ 11695] ERROR - llij.ide.plugins.PluginManager - null
java.lang.AssertionError
  at com.android.tools.idea.templates.KeystoreUtils.getOrCreateDefaultDebugKeystore(KeystoreUtils.java:81)
  at com.android.tools.idea.wizard.NewProjectWizardDynamic.init(NewProjectWizardDynamic.java:97)
  at com.android.tools.idea.actions.AndroidNewProjectAction.actionPerformed(AndroidNewProjectAction.java:38)
  at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:164)
  at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:170)
  at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:133)
  at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:313)
  at java.awt.Component.processEvent(Component.java:6062)
  at java.awt.Container.processEvent(Container.java:2039)
  at java.awt.Component.dispatchEventImpl
mickelfeng
记得加上-Dawt.useSystemAAFontSettings=lcd这个参数,在idea.exe.vmoptions上加上
-Dawt.useSystemAAFontSettings=lcd之后idea启动
×
mickelfeng
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: