1. 程式人生 > 其它 >Zookeeper 編譯環境安裝

Zookeeper 編譯環境安裝

技術標籤:語言開發linux

Java環境安裝

下載:Linux系統Java下載 這裡

解壓:

mkdir /usr/local/java && tar xvfjre-8u281-linux-x64.tar.gz -C /usr/local/java

配置:

# 寫入配置
cat >> /etc/profile << EOF
#java environment
export JAVA_HOME=/usr/local/java/jre1.8.0_281
export JRE_HOME=\${JAVA_HOME}/jre
export CLASSPATH=.:\${JAVA_HOME}/lib:\${JRE_HOME}/lib
export PATH=\${JAVA_HOME}/bin:\${PATH}
EOF
# 重新整理變數
source /etc/profile

驗證

java -version

Maven安裝

安裝: 連結下載3.6.3Maven官網

解壓: 略

配置:

cat >> /etc/profile << EOF
# maven
export MAVEN_HOME=/usr/local/maven3.6
export PATH=\$MAVEN_HOME/bin:\$PATH
EOF
# flush
source /etc/profile

驗證

mvn -v

配置mirror:

修改 /usr/local/maven3.6/conf/settings.xml

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          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">
 
  <pluginGroups>

  </pluginGroups>
  <!-- 配置jar包下載路徑 linux需要更改為/目錄開頭的linux目錄 -->
  <localRepository>/root/.m2/repository</localRepository>



  <proxies>
  													
  </proxies>


  <servers>
   				
  </servers>

  <!-- 從阿里雲映象下載jar包 -->
  <mirrors>
	<mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
  </mirrors>

 <!-- 指定jdk1.8 -->
 <profiles>
	<profile>	
		<id>jdk1.8</id>
		<activation>
		<activeByDefault>true</activeByDefault>
		<jdk>1.8</jdk>
		</activation>

		<properties>
			<maven.compiler.source>1.8</maven.compiler.source>
			<maven.compiler.target>1.8</maven.compiler.target>
			<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
		</properties>
	</profile>
</profiles>

</settings>