Skip to content

Commit

Permalink
[Misc] Remove java 7 + update java 17 installation to be simpler (and…
Browse files Browse the repository at this point in the history
… fix the fact that for some reason it wasn't working anymore)
  • Loading branch information
vmassol committed Mar 13, 2024
1 parent 420d3ce commit 88c24d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
27 changes: 6 additions & 21 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,17 @@ RUN apt-get --no-install-recommends -y install libasound2 && \

WORKDIR /root

# Add Zulu repository to install Java7
# TODO: Remove once we don't have any Contrib extension using a minimum version of XWiki supporting Java 7.
# Instructions from https://docs.azul.com/zulu/zuludocs/#ZuluUserGuide/PrepareZuluPlatform/AttachAPTRepositoryUbuntuOrDebianSys.htm
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
RUN echo 'deb https://repos.azulsystems.com/debian stable main' > /etc/apt/sources.list.d/zulu.list
RUN apt-get update && \
apt-get --no-install-recommends -y install zulu-7

# Install Java 8
# TODO: Remove once we don't have any Contrib extension using a minimum version of XWiki supporting Java 8.
RUN wget --no-verbose -O /usr/lib/jvm/java8.tar.gz https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz && \
RUN mkdir -p /usr/lib/jvm && \

This comment has been minimized.

Copy link
@tmortagne

tmortagne Mar 13, 2024

Member

Might be safer and simpler to use the adoptium debian repository.

This comment has been minimized.

Copy link
@vmassol

vmassol Mar 13, 2024

Author Member

Safer idk, but not simpler since that repo needs to be added. Last time I tried there were problems. For now I'll keep it like this until next time, but if someone wants to change it & test it, please go ahead.

This comment has been minimized.

Copy link
@tmortagne

tmortagne Mar 13, 2024

Member

Last time I tried there were problems

Last time you tried this repository probably did not exist.

wget --no-verbose -O /usr/lib/jvm/java8.tar.gz https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz && \
tar -C /usr/lib/jvm -xzf /usr/lib/jvm/java8.tar.gz && \
rm /usr/lib/jvm/java8.tar.gz

# Install Java 17
# Needed for Sonarcloud now requiring Java 17.
# TODO: Remove `-o "Acquire::https::Verify-Peer=false"` once the following errors are fixed:
# Err:8 https://repos.azul.com/zulu/deb stable Release
# Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.
# Could not handshake: Error in the certificate verification. [IP: 104.18.0.192 443]
# Reading package lists...
# E: The repository 'https://repos.azul.com/zulu/deb stable Release' does not have a Release file.
RUN apt-get -o "Acquire::https::Verify-Peer=false" update && \
apt-get -o "Acquire::https::Verify-Peer=false" --no-install-recommends -y install zulu17-jdk
RUN wget --no-verbose -O /usr/lib/jvm/java17.deb https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.deb && \

This comment has been minimized.

Copy link
@tmortagne

tmortagne Mar 13, 2024

Member

Would probably be simpler on the long run to use the adoptium debian repository too, no need to worry if Oracle still support the version or not (for example for Java 17 they will stop in September), and it would be the same repository for all versions of Java.

apt install /usr/lib/jvm/java17.deb && \
rm /usr/lib/jvm/java17.deb

# Copy VNC config files
COPY vnc/.Xauthority .Xauthority
Expand All @@ -130,15 +117,13 @@ RUN wget --no-check-certificate https://archive.apache.org/dist/maven/maven-3/$M
# - Java17 to be available at /home/hudsonagent/java17
# - Java11 to be available at /home/hudsonagent/java11
# - Java8 to be available at /home/hudsonagent/java8
# - Java7 to be available at /home/hudsonagent/java7
# - Maven to be available at /home/hudsonagent/maven
# - Default java to be Java 17
# - "mvn" to be on the path
RUN mkdir -p /home/hudsonagent && \
ln -fs $JAVA_HOME /home/hudsonagent/java11 && \
ln -fs /usr/lib/jvm/zulu17 /home/hudsonagent/java17 && \
ln -fs /usr/lib/jvm/jdk-17-oracle-x64 /home/hudsonagent/java17 && \
ln -fs /usr/lib/jvm/jdk8u312-b07 /home/hudsonagent/java8 && \
ln -fs /usr/lib/jvm/zulu-7-amd64 /home/hudsonagent/java7 && \
ln -fs /home/hudsonagent/java17 /home/hudsonagent/java && \
ln -fs /home/hudsonagent/java/bin/java /usr/bin/java && \
ln -fs /root/apache-maven-$MAVEN_VERSION /home/hudsonagent/maven && \
Expand Down
1 change: 0 additions & 1 deletion build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ This image adds the following XWiki-required build tools over the
[`jenkins/ssh-slave`](https://hub.docker.com/r/jenkinsci/ssh-slave) base image provided by Jenkins:
* VNC Server
* Docker Client (to run our Docker-based tests)
* Java 7 (Should be removed once no build is using it anymore)
* Java 8 (Should be removed once no build is using it anymore)
* Java 11 is provided by the base image
* Java 17 (the java version required to build XWiki master)
Expand Down

0 comments on commit 88c24d6

Please sign in to comment.