deepin linux 初始化開發環境 jdk 、maven、docker

每次重裝系統都要把開發環境弄回來,這裏就記錄一下把

1、jdk

這裏直接使用openjdk 就行了

apt-cache search jdk //查詢現有的jdk
apt-get install openjdk-8-jdk  //安裝jdk8
java -version //查看一下是否安裝成功

2、maven

apt-get install maven
mvn -version

修改settings.xml 文件
vim /etc/maven/settings.xml

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository> 
  -->
<!--指定本地倉庫地址-->
 <localRepository>/var/lib/maven</localRepository> 
  <!-- interactiveMode
   | This will determine whether maven prompts you when it needs input. If set to false,
   | maven will use a sensible default value, perhaps based on some other setting, for
   | the parameter in question.
   |
   | Default: true
  <interactiveMode>true</interactiveMode>
  -->



<!--安裝阿里雲鏡像-->
  <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
  </mirror>

3、docker

sudo apt-get remove docker docker-engine docker.io
sudo apt-get update
sudo apt-get install \
     apt-transport-https \
     ca-certificates \
     curl \
     gnupg2 \
     software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian \
   wheezy \
   stable"
sudo apt-get update
sudo apt-get install docker-ce

修改docker鏡像爲阿里雲鏡像
vim /etc/docker/daemon.json

{
  "registry-mirrors": [
    "https://j0andt2p.mirror.aliyuncs.com"
  ],
  "insecure-registries": [],
  "debug": true,
  "experimental": false
}
systemctl start docker
systemctl restart docker
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章