003.centos7.3安装openjdk8

直接上脚本,不废话

# docker centos7.3
# 查看操作心痛
$ cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

# 更新 yum 类库 
yum update 

# 安装openjdk7
$ tar -zxf  jdk-7u79-linux-x64.tar.gz
# 配置环境变量
$ vim ~/.bashrc

JAVA_HOME=/usr/local/jdk/jdk1.7.0_79
export JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH

# 安装些工具
$ yum install -y wget tree lrzsz zip unzip vim 

# 编译环境依赖的类库
yum -y install bzip2 bzip2-devel
yum -y install gdbm gdbm-devel
yum -y install libffi-devel ncurses ncurses-devel
yum -y install openssl openssl-devel openssl-static
yum -y install readline readline-devel
yum -y install sqlite sqlite-devel
yum -y install tk tk-devel xz lzma xz-devel  zlib zlib-devel
yum groupinstall "Development Tools"
yum install alsa-lib-devel cups-devel libX* gcc gcc-c++ freetype-devel libstdc++-static ant make
yum install libXtst-devel libXt-devel libXrender-devel
 
yum install ccache(这个yum安装不了,这个是提交编译速度的,不安装速度慢一些,不影响编译)


# openjdk构建
$ ./configure --with-target-bits=64 --with-boot-jdk=/usr/local/jdk/jdk1.7.0_79 --with-debug-level=slowdebug --enable-debug-symbols ZIP_DEBUGINFO_FILES=0

# 编译
$ make all ZIP_DEBUGINFO_FILES=0  


# 在编译时出现的问题,需要支持 linux内核 5版本
*** This OS is not supported: Linux 1341611fe4ef 5.10.25-linuxkit #1 SMP Tue Mar 23 09:27:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
gmake[5]: *** [check_os_version] Error 1
gmake[4]: *** [linux_amd64_compiler2/fastdebug] Error 2
gmake[3]: *** [generic_build2] Error 2
gmake[2]: *** [debug] Error 2
gmake[1]: *** [/usr/local/jdk/open

文件hotspot/make/linux/Makefile

-SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 
+SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 5%


# 构建完成标记
----- Build times -------
Start 2021-06-22 08:41:01
End   2021-06-22 08:57:01
00:00:43 corba
00:00:56 demos
00:02:13 docs
00:05:29 hotspot
00:01:01 images
00:00:18 jaxp
00:00:28 jaxws
00:04:37 jdk
00:00:00 langtools
00:00:14 nashorn
00:16:00 TOTAL
-------------------------
posted @ 2021-06-22 09:07  可可逗豆  阅读(62)  评论(0)    收藏  举报