Setup openjdk development environment on ubuntu desktop

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/KimSoft/article/details/74571686

1. Install ubuntu desktop on physical machine or vm

You can download Ubuntu 16.04.2 LTS (recommend) from https://www.ubuntu.com/download/desktop

1.1. Use source of USTC, it is faster in china

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list

1.2. Update system

sudo apt-get update
sudo apt-get -y dist-upgrade
sudo apt-get autoclean
reboot

2. Install tools

2.1. Install vim

sudo apt-get install vim

2.2 Install openjdk

sudo dpkg -l | grep java
#uninstall java if exsit
sudo apt-get install openjdk-8-jdk
java -version

2.3 Install maven

sudo apt-cache search maven
sudo apt-get install maven
mvn -v

Cofig environment

sudo vim /etc/environment

export JAVA_HOME=”/usr/lib/jvm/java-8-openjdk-amd64/jre”
export M2_HOME=”/usr/share/maven”
PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games”

source /etc/environment
echo $PATH
java -version
mvn -v

2.4. Install git

sudo apt-cache search git
sudo apt-get install git
sudo vim ~/.gitconfig
[core]
    autocrlf = input
    safecrlf = true
[user]
    email = xxx@xxx.com
    name = xxx
[alias]
    lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
[color]
    ui = true
[http]
    sslVerify = false

2.5. Install Eclipse

download and run eclipse
import and config project in eclipse

sudo mv ~/Download/eclipse /usr/local
sudo vim /usr/share/applications/eclipse.desktop
[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;

applications search eclipse

Enjoy it.

阅读更多
换一批

没有更多推荐了,返回首页