File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,8 +181,11 @@ RUN apt-get -q update && apt-get -q install --no-install-recommends -y openjdk-8
181181RUN apt-get -q update && apt-get -q install --no-install-recommends -y default-jre-headless openjdk-11-jdk-headless \
182182 && apt-get clean \
183183 && rm -rf /var/lib/apt/lists/* \
184- && update-java-alternatives -s java-1.8.0-openjdk-amd64 \
185- && rm -f /usr/lib/jvm/default-java \
184+ && update-java-alternatives -s java-1.8.0-openjdk-amd64
185+ # since update alternatives might fail on executables that we don't really need (e.g. appletviewer)
186+ # and return with exit code <0 (actually: 2), we can simply do a sanity check if the version is
187+ # as expected for "java" executable after the update and go on
188+ RUN java -version 2>&1 | grep "1.8.0" && rm -f /usr/lib/jvm/default-java \
186189 && ln -s java-8-openjdk-amd64 /usr/lib/jvm/default-java
187190ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
188191
You can’t perform that action at this time.
0 commit comments