【CentOS7】开发环境配置OpenJDK
【CentOS7】开发环境配置OpenJDK
目录
=====================================================================
1、安装openjdk
2、配置域名
3、安装python
4、安装maven
=====================================================================
1、安装openjdk
下载地址:http://openjdk.java.net/install/
先查看系统有没有自带的openjdk
rpm -qa |grep java
rpm -qa |grep jdk
rpm -qa |grep gcj
如果安装了,首先卸载,批量卸载
rpm -qa | grep java | xargs rpm -e --nodeps
检索yum中有没有java1.8的包
yum list java-1.8*
开始安装,安装目录 /usr/lib/jvm/java-1.8.0
yum install java-1.8.0-openjdk -y
vim /root/.bash_profile
JAVA_HOME=/usr/lib/jvm/java-1.8.0 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export CLASSPATH
vim /etc/profile
JAVA_HOME=/usr/lib/jvm/java-1.8.0 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export CLASSPATH
生效
source /root/.bash_profile
检查是否配置好了
echo $JAVA_HOME java -version
2、配置域名
先在/etc/hostname配置想要的域名 consul
在/etc/hosts 配置ip和域名映射 192.168.0.101 consul
3、安装python
yum -y install epel-release
yum -y install python-pip
4、安装maven
# curl -O http://mirror.bit.edu.cn/apache/maven/maven-3/3.6.2/binaries/apache-maven-3.6.2-bin.tar.gz # tar -zxvf apache-maven-3.6.2-bin.tar.gz # vim /etc/profile MAVEN_HOME=/usr/local/apache-maven-3.6.2 export MAVEN_HOME export PATH=${PATH}:${MAVEN_HOME}/bin
# source /etc/profile # mvn -version # cd /usr/local/apache-maven-3.6.2 # mkdir repository # chmod -R 777 repository # cd /usr/local/apache-maven-3.6.2/conf # vim settings.xml <localRepository>/usr/local/apache-maven-3.6.2/repository</localRepository>