Ansible playbook for java installation.
[TOC]
Support java distribution type:
- Adopt OpenJDK
- Alibaba Dragonwell
- Amazon Corretto
- Liberica OpenJDK
- Tencent Kona
- Oracle JDK
- Platforms:
- CentOS-7
- Fedora
- Dependencies:
- ansible
-
yum -y install ansible
-
git clone https://github.com/zakzhu/java-install.git
-
Download the relevant openjdk tarball from the following website:
# JDK Pacakge Name: # - Adopt OpenJDK https://github.com/AdoptOpenJDK/openjdk8-binaries/releases # - Alibaba Dragonwell https://github.com/alibaba/dragonwell8/releases # - Amazon Corretto https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html # - Liberica OpenJDK https://bell-sw.com/pages/downloads/#/java-8-lts # - Tencent Kona https://github.com/Tencent/TencentKona-8/releases # - Oracle JDK https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html
-
cp OPENJDK-TARBALL java-install/roles/get_pkg/files/
vim java-install/inventories/staging/host_vars/localhost.yml
EXAMPLE:
deploy_root: /usr/local ######################## # Adopt OpenJDK ######################## package: name: adopt-openjdk alias: java version: 8u275b01 dgst_algo: sha256 checksum: 06fb04075ed503013beb12ab87963b2ca36abe9e397a0c298a57c1d822467c29 type: binary package_tarball: "OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz"
ansible-playbook -i inventories/staging/inventory site.yml
source /etc/profile
See the contribution guide.
Please see FAQ.md for frequently asked questions.
The following excellent people helped massively:
Java-Install is licensed under the BSD-3-Clause license. Copyright © 2020, Zak Zhu