Java (Application)

From campisano.org
(Redirected from Jdk (Java Development Kit))
Jump to navigation Jump to search

Install

# shared/opt install schema v1.5.5

#### as common user ####
# define applications vars
export SOFTWARE_PATH="/home/shared/opt/software"
export NAME="jdk"
# example for java 15
export VERSION="15.0.1"
export URL="https://download.java.net/java/GA/jdk${VERSION}/51f4f36ad4ef43e39d0dfdbaf6549e32/9/GPL/openjdk-${VERSION}_linux-x64_bin.tar.gz"
# OR example for java 14
export VERSION="14.0.2"
export URL="https://download.java.net/java/GA/jdk${VERSION}/205943a0976c4ed48cb16f1043c5c647/12/GPL/openjdk-${VERSION}_linux-x64_bin.tar.gz"
# OR example for java 11
export VERSION="11.0.2"
export URL="https://download.java.net/java/GA/jdk11/9/GPL/openjdk-${VERSION}_linux-x64_bin.tar.gz"
# THEN
su - -w SOFTWARE_PATH,NAME,VERSION

#### as root ####
# install packages and prepare destination path
apt-get -qq -y install wget coreutils findutils tar gzip
mkdir -m 777 "${SOFTWARE_PATH}/tmp_install/" "${SOFTWARE_PATH}/${NAME}_${VERSION}/"
exit

#### as common user ####
umask 0027
cd "${SOFTWARE_PATH}/tmp_install"
wget -c --no-check-certificate "${URL}"
tar -xzf "openjdk-${VERSION}_linux-x64_bin.tar.gz"
cd "jdk-${VERSION}"
mv * "${SOFTWARE_PATH}/${NAME}_${VERSION}"
cd
su - -w SOFTWARE_PATH,NAME,VERSION

#### as root ####
# ensure permissions to destination path
cd "${SOFTWARE_PATH}"
chown -R root:users "${NAME}_${VERSION}"
find "${NAME}_${VERSION}" -type d -exec chmod a-s,u+rwx,g+rx,g-w,o-rwx {} \;
find "${NAME}_${VERSION}" -type f -exec chmod a-s,u+rw,g+r,g-w,o-rwx {} \;
rm -rf tmp_install
ln -s -f -T "${NAME}_${VERSION}" "${NAME}"
exit

#### as common user ####
# test the application (you can put the follow in ~/.profile)
export SOFTWARE_PATH="/home/shared/opt/software"
export JAVA_HOME="${SOFTWARE_PATH}/jdk"
export PATH="${JAVA_HOME}/bin:${PATH}"
export LD_LIBRARY_PATH="${JAVA_HOME}/lib:${LD_LIBRARY_PATH}"
java --version

Patterns

J2EE

Webmail

WebApps

Struts

Multiple Forms

Generic