We migrate to JDK 17

This  is a hard requirement to be able to migrate
to a more recent jetty version, which may happen sometime soon.
This commit is contained in:
Michael Peter Christen committed 2026-07-10 22:47:39 +02:00
1 parent 3950a4f49b
commit dd0225bdde
12 files changed
+75 -37

No files matched your search

@@ -8,10 +8,10 @@ jobs:
if: github.repository == 'yacy/yacy_search_server'
steps:
- uses: actions/checkout@master
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Build with ant
run: ant clean all dist
+2 -2
View File
@@ -18,10 +18,10 @@ jobs:
with:
fetch-depth: 0 # Required for git version info in build
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Install build dependencies
+2 -2
View File
@@ -55,11 +55,11 @@ To get a ready-to-run production package, run YaCy from Docker.
### Compile and run YaCy from git sources
You need Java 11 or later to run YaCy and ant to build YaCy.
You need Java 17 or later to run YaCy and ant to build YaCy.
This would install the requirements on debian:
```
sudo apt-get install openjdk-11-jdk-headless ant
sudo apt-get install openjdk-17-jdk-headless ant
```
Then clone the repository and build the application:
+9 -6
View File
@@ -67,9 +67,9 @@ SetCompressor /SOLID LZMA
!insertmacro MUI_LANGUAGE "English"
LangString javaMissing 0 "Java 11 or newer is required to run YaCy. Download and install the latest Temurin JRE now?"
LangString javaDownloadFail 0 "Java download failed. Please install Java 11+ manually."
LangString javaInstallFail 0 "Java 11+ was not found after installation. YaCy may not start until Java is installed."
LangString javaMissing 0 "Java 17 or newer is required to run YaCy. Download and install the latest Temurin JRE now?"
LangString javaDownloadFail 0 "Java download failed. Please install Java 17+ manually."
LangString javaInstallFail 0 "Java 17+ was not found after installation. YaCy may not start until Java is installed."
LangString keepData 0 "Remove YaCy user data as well?"
Var JavaVersion
@@ -150,7 +150,9 @@ Function EnsureJava
Call GetJavaVersion
Push "Java detection: found=$JavaFound version='$JavaVersion' major=$JavaMajor"
Call LogLine
StrCmp $JavaFound "1" JavaOk JavaMissing
StrCmp $JavaFound "1" JavaVersionCheck JavaMissing
JavaVersionCheck:
IntCmp $JavaMajor 17 JavaOk JavaMissing JavaOk
JavaMissing:
Push "Java detection: no Java found"
Call LogLine
@@ -171,6 +173,7 @@ Function EnsureJava
Push "Java detection (post-install): found=$JavaFound version='$JavaVersion' major=$JavaMajor"
Call LogLine
StrCmp $JavaFound "1" 0 JavaStillLow
IntCmp $JavaMajor 17 JavaContinue JavaStillLow JavaContinue
JavaStillLow:
MessageBox MB_ICONEXCLAMATION "$(javaInstallFail)"
JavaContinue:
@@ -203,8 +206,8 @@ Function GetJavaVersion
Call FindJavaFromPath
${If} $JavaFound == "1"
${If} $JavaMajor == "0"
StrCpy $JavaMajor "11"
Push "Java detection: version unknown, assuming >=11"
StrCpy $JavaMajor "17"
Push "Java detection: version unknown, assuming >=17"
Call LogLine
${EndIf}
${EndIf}
+2 -3
View File
@@ -1,6 +1,5 @@
# defining some compiler arguments
javacSource=11
javacTarget=11
# Java release used for source compatibility, API compatibility and bytecode
javacRelease=17
# Release Configuration
releaseVersion=1.941
+4 -4
View File
@@ -179,8 +179,8 @@
<echo message="project.class.path: ${toString:project.class.path}" />
<javac srcdir="${src}/" destdir="${build}"
debug="true" debuglevel="lines,vars,source" includeantruntime="false"
source="${javacSource}" target="${javacTarget}" encoding="UTF-8"
nowarn="on">
release="${javacRelease}" encoding="UTF-8"
nowarn="on">
<classpath refid="project.class.path" />
<compilerarg value="-Xlint:unchecked"/>
</javac>
@@ -336,8 +336,8 @@
<!-- run unittests-->
<target name="compileTest" depends="compile" description="run unittests">
<javac srcdir="${test}" destdir="${test}"
debug="true" debuglevel="lines,vars,source"
source="${javacSource}" target="${javacTarget}" encoding="UTF-8">
debug="true" debuglevel="lines,vars,source" includeantruntime="false"
release="${javacRelease}" encoding="UTF-8">
<classpath>
<pathelement location="${build}"/>
<path refid="compile.path"/>
+6 -13
View File
@@ -7,28 +7,21 @@
# docker run -d --name yacy -p 8090:8090 -p 8443:8443 -v yacy_data:/opt/yacy_search_server/DATA --log-opt max-size=200m --log-opt max-file=2 yacy/yacy_search_server:armv7
# Base image : latest Debian stable official jdk 11 image from Docker
FROM arm32v7/openjdk:11-jdk as builder
# Java 17 is installed from Debian's ARMv7 packages.
FROM arm32v7/debian:bookworm-slim
# Install needed packages not in base image
RUN apt-get update && apt-get install -yq curl && \
RUN apt-get update && apt-get install -yq ant curl openjdk-17-jdk-headless && \
rm -rf /var/lib/apt/lists/*
# set current working dir & copy sources
WORKDIR /opt
COPY . /opt/yacy_search_server/
# .git dir deleted here because .git is needed during the build to deterime the version,
# .git dir is deleted after the build because it is needed to determine the version,
# but isn't required at runtime
RUN ant compile -f /opt/yacy_search_server/build.xml \
RUN rm -rf /opt/yacy_search_server/.git && \
apt-get update && \
apt-get install -yq ant && \
ant compile -f /opt/yacy_search_server/build.xml && \
apt-get purge -yq --auto-remove ant && \
apt-get clean && \
rm -fr /opt/yacy_search_server/.git && \
rm -rf /var/lib/apt/lists/*
RUN ant compile -f /opt/yacy_search_server/build.xml && \
rm -rf /opt/yacy_search_server/.git
# Set initial admin password: "yacy" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex())
RUN sed -i "/adminAccountBase64MD5=/c\adminAccountBase64MD5=MD5:8cffbc0d66567a0987a4aba1ec46d63c" /opt/yacy_search_server/defaults/yacy.init && \
+13 -1
View File
@@ -311,7 +311,19 @@ elif command -v /usr/libexec/java_home >/dev/null 2>&1; then
fi
if [[ -z "${JAVA_BIN}" ]]; then
echo "Unable to find a Java runtime. Please install Java (JDK 11+) and try again." >&2
echo "Unable to find a Java runtime. Please install Java (JDK 17+) and try again." >&2
exit 1
fi
JAVA_SPEC_VERSION="$("${JAVA_BIN}" -XshowSettings:properties -version 2>&1 | sed -n 's/^[[:space:]]*java.specification.version = //p' | head -n 1)"
JAVA_MAJOR_VERSION="${JAVA_SPEC_VERSION#1.}"
JAVA_MAJOR_VERSION="${JAVA_MAJOR_VERSION%%.*}"
if [[ ! "${JAVA_MAJOR_VERSION}" =~ ^[0-9]+$ ]]; then
echo "Unable to determine the Java version reported by ${JAVA_BIN}." >&2
exit 1
fi
if (( JAVA_MAJOR_VERSION < 17 )); then
echo "Java 17 or newer is required to run YaCy (found Java ${JAVA_SPEC_VERSION})." >&2
exit 1
fi
+2 -2
View File
@@ -45,7 +45,7 @@ parts:
- dist
source: https://github.com/yacy/yacy_search_server.git
build-packages:
- openjdk-8-jdk
- openjdk-17-jdk
override-build: |
snapcraftctl build
tar -xzf RELEASE/yacy*.tar.gz -C "$SNAPCRAFT_PART_INSTALL/"
tar -xzf RELEASE/yacy*.tar.gz -C "$SNAPCRAFT_PART_INSTALL/"
@@ -11,7 +11,7 @@
<property name="parserArchive" location="${release}/${addonLongName}_${addonVersion}.tgz"/>
<target name="compile">
<javac srcdir="${src}/net/yacy/peers/operation/" destdir="${build}" source="${javacSource}" target="${javacTarget}" debug="true" debuglevel="lines,vars,source">
<javac srcdir="${src}/net/yacy/peers/operation/" destdir="${build}" release="${javacRelease}" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
<include name="yacySeedUpload${addonShortName}.java"/>
<classpath>
<pathelement location="${build}" />
@@ -70,4 +70,3 @@
</project>
+17
View File
@@ -1,6 +1,23 @@
@Echo Off
title YaCy
where java >nul 2>&1
if errorlevel 1 (
Echo Java was not found. Java 17 or newer is required to run YaCy.
GoTo :END
)
set "JAVA_SPEC_VERSION="
for /F "tokens=3" %%v in ('java -XshowSettings:properties -version 2^>^&1 ^| findstr /C:"java.specification.version ="') do set "JAVA_SPEC_VERSION=%%v"
if not defined JAVA_SPEC_VERSION (
Echo Unable to determine the installed Java version. Java 17 or newer is required.
GoTo :END
)
for /F "tokens=1 delims=." %%v in ("%JAVA_SPEC_VERSION%") do set "JAVA_MAJOR_VERSION=%%v"
if %JAVA_MAJOR_VERSION% LSS 17 (
Echo Java 17 or newer is required to run YaCy. Found Java %JAVA_SPEC_VERSION%.
GoTo :END
)
REM setting startup type for proper restart
if "%YACY_DATA%"=="" set "YACY_DATA=%LOCALAPPDATA%\YaCy"
set "YACY_DATA_DIR=%YACY_DATA%\DATA"
+15
View File
@@ -38,6 +38,21 @@ then
exit 1
fi
JAVA_SPECIFICATION_VERSION="`"$JAVA" -XshowSettings:properties -version 2>&1 | sed -n 's/^[[:space:]]*java.specification.version = //p' | head -n 1`"
JAVA_MAJOR_VERSION="${JAVA_SPECIFICATION_VERSION#1.}"
JAVA_MAJOR_VERSION="${JAVA_MAJOR_VERSION%%.*}"
case "$JAVA_MAJOR_VERSION" in
''|*[!0-9]*)
echo "Unable to determine the Java version reported by $JAVA."
exit 1
;;
esac
if [ "$JAVA_MAJOR_VERSION" -lt 17 ]
then
echo "Java 17 or newer is required to run YaCy (found Java $JAVA_SPECIFICATION_VERSION)."
exit 1
fi
usage() {
cat - <<USAGE