环境搭建
- 安装Android Studio
官网下载 https://developer.android.google.cn/studio - Java环境
官网下载jdk https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html - 将jdk解压并拷贝至/usr/lib/java路径下
cd ~/Doucements
tar -zxf jdk-8u25-linux-x64.tar.gz
sudo cp -r ~/jdk1.8.0_25 /usr/lib/java
或者
sudo tar zxvf jdk-8u25-linux-x64.tar.gz -C /usr/lib/jvm
- 配置环境变量
sudo gedit ~/.profile
- 在末尾添加下面这一行:
# set java environmentexport JAVA_HOME=/usr/lib/jvm/jdk1.8.0_25 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
- 保存并关闭,然后使用source进行更新:
source ~/.profile