centos7配置java和python环境
centos7配置java环境
# 1.下载jdk安装包并解压tar -zxvf https://repo.huaweicloud.com/java/jdk/
# 2.安装vim
yum install vim
# 3.编辑
vim /etc/profile
# 输入内容
export JAVA_HOME=/except/jdk1.8.0_261
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
esc:wq
# 4.生效
source /etc/profile
# java -version查看
centos7配置python环境
# 1.下载python安装包https://www.python.org/ftp/python/并解压tar -zxvf
# 2.安装gcc依赖
yum install openssl-devel -y
yum install zlib-devel -y
yum install gcc -y
yum install libffi-devel -y
# 3.配置
./configure
# 4.编译(编译成2进制)和安装(安装编译后的可执行文件)
make&&make install
# 5.创建软链接(python3 -V能用就忽略)
# 创建python3的环境变量软链接,地址是安装的python3.10,不要改变python这个软链接,因为python预装2.7,有许多系统依赖2.7
ln -s /usr/local/bin/python3.10 /usr/bin/python3
# 创建pip3的软链接,同时改变pip的软链接(pip不影响,都改了方便使用,也可以只改pip3)
ln -s /usr/local/bin/pip3.10 /usr/bin/pip3
ln -s /usr/local/bin/pip3.10 /usr/bin/pip
# python3 -V和pip3 -V查看(同时查看python -V和pip -V)
评论区