JDK安裝
1、官網(wǎng)下載JDK
地址: http://www.oracle.com/technetwork/articles/javase/index-jsp-138363.html
選擇相應(yīng)的 .gz包下載
2护糖、解壓縮,放到指定目錄(以jdk-7u60-linux-x64.gz為例)
創(chuàng)建目錄:
sudo mkdir /usr/lib/jvm
加壓縮到該目錄:
sudo tar -zxvf jdk-7u60-linux-x64.gz -C /usr/lib/jvm
3、修改環(huán)境變量:
????sudo vim ~/.bashrc
文件的末尾追加下面內(nèi)容:
????#set oracle jdk environment
????????export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_192? ## 這里要注意目錄要換成自己解壓的jdk 目錄
????????export JRE_HOME=${JAVA_HOME}/jre?
????????export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib?
????????export PATH=${JAVA_HOME}/bin:$PATH?
?使環(huán)境變量馬上生效
????????source ~/.bashrc
4洗出、設(shè)置系統(tǒng)默認jdk 版本
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_192/bin/java 300?
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_192/bin/javac 300?
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.8.0_192/bin/jar 300?
sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk1.8.0_192/bin/javah 300?
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk1.8.0_192/bin/javap 300?
然后執(zhí)行:
sudo update-alternatives --config java
若是初次安裝jdk,會有下面的提示? ?
? There is only one alternative in link group java (providing /usr/bin/java):
/usr/lib/jvm/jdk1.8.0_192/bin/java
否者,選擇合適的jdk
5竹椒、測試jdk
java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
jdk 安裝成功
maven 安裝
下載 http://maven.apache.org/download.cgi
sudo mkdir /opt/maven
sudo tar zxvf apache-maven-3.5.4-bin.tar.gz
export M2_HOME=/home/penghuang/software/apache-maven-3.5.4
export M2=$M2_HOME/bin
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=$M2:$PATH
測試使用 mvn -version
eclipse安裝
1褐墅、 在官網(wǎng)上下載eclipse
http://www.eclipse.org/downloads/下載? ?eclipse-jee-luna-SR1-linux-gtk-x86_64.tar.gz
2、 解壓eclipse
$ tar -zxvf eclipse-jee-luna-SR1-linux-gtk-x86_64.tar.gz
3樱调、 將文件夾移動到安裝目錄
$?sudo mv eclipse /usr/local/
4、 啟動eclipse
?$?/usr/local/eclipse/eclipse
5届良、 創(chuàng)建桌面快捷方式
????sudo su?
????輸入密碼
????$?vim /usr/share/applications/eclipse.desktop
6 在其中寫入
[Desktop Entry]
Name=Eclipse
Comment=Eclipse SDK
Encoding=UTF-8
Exec=/usr/local/eclipse/eclipse
Icon=/usr/local/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=Application;Development;
已經(jīng)Eclipse完成安裝使用