First,download&install JDK and configure environment variable.
-
Enter the official website to download JDK8 or JDK9(Must hook on
Accept License Agreement
option to start download)
choose a JDK suit for the version of your Linux system -
After downloaded部默,cut or copy the JDK file to whatever directory you like.
you can do so by file manager or terminal.
move
mv <目標(biāo)文件> <目標(biāo)路徑>
extract
tar -xvf file.tar //extract tar package
tar -xzvf file.tar.gz //extract tar.gz
tar -xjvf file.tar.bz2 //extract tar.bz2
tar -xZvf file.tar.Z //extract tar.Z
unrar e file.rar //extract rar
unzip file.zip //extract zip
-
Configure environment variable
sudo vim /etc/profile
append the following codes in the last of the file
export JAVA_HOME=/home/cwj/jdk1.8.0_144 //be careful, this path should be the same as the location of your JDK. export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin:$PATH
>Make the change work in this terminal
source /etc/profile
Check whether it is work or not
java -version
If your terminal has the same output as the picture, it means that it is work properly.
二、Install Android Studio
- Download Android Studio from the official website. Choose Linux version
- When finished downloading,move the package to a directory and extract it.
- Enter./android-studio/bin directory啡氢,double click studio.sh to start.
- And then, you can use Android Studio to build your Android application.
一激才、下載安裝JDK并配置環(huán)境變量
-
進(jìn)入官網(wǎng)下載JDK燃少。(要 勾選 Accept License Agreement 才能下載哦)
選擇Linux版本的JDK 我自己選擇的是Linux ×64 176.92MB那個把鉴。
-
下載完成后故响,將文件拷貝或剪切到你自己喜歡的文件夾中解壓
可以用文件管理器(和Windows的操作一樣)也可以用終端命令操作检盼。
移動
mv <目標(biāo)文件> <目標(biāo)路徑>
解壓
tar -xvf file.tar //解壓 tar包
tar -xzvf file.tar.gz //解壓tar.gz
tar -xjvf file.tar.bz2 //解壓 tar.bz2
tar -xZvf file.tar.Z //解壓tar.Z
unrar e file.rar //解壓rar
unzip file.zip //解壓zip
配置環(huán)境變量
sudo vim /etc/profile
vim 在normal模式下按 i 就可以輸入肯污,輸入完成后 按Esc鍵進(jìn)入normal模式再按:鍵,輸入wq(保存退出)吨枉,再回車即可蹦渣。如果實(shí)在不會用vim 可以選擇使用gedit
sudo gedit /etc/profile
(輸入完記得要保存)。
- 打開文件后在末尾輸入
export JAVA_HOME=/home/cwj/jdk1.8.0_144 //注意該路徑需要改為你的JDK所在路徑
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin:$PATH
_SILENT_JAVA_OPTIONS="$_JAVA_OPTIONS"
unset _JAVA_OPTIONS
alias java='java "$_SILENT_JAVA_OPTIONS"'
使改變在本終端生效
source /etc/profile
配置好以后东羹,查看是否成功
java -version
-
如果結(jié)果如下圖剂桥,表示JDK安裝成功
二、安裝Android Studio
- 在中文社區(qū)(官網(wǎng))下載 Linux版 的Android Studio
- 下載完成后属提,移動到你的應(yīng)用存放目錄权逗,解壓
- 進(jìn)入./android-studio/bin目錄,雙擊打開studio.sh
- 然后就可以開始配置Android Studio啦