From 2136a791b9022aeba3d6df147d5257c87ce89989 Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Thu, 3 Apr 2025 10:48:57 +0200 Subject: [PATCH] Update to java 21 --- .github/workflows/alarm-logger-docker-image.yml | 6 +++--- .github/workflows/alarm-server-docker-image.yml | 6 +++--- .github/workflows/build.yml | 2 +- .github/workflows/build_latest.yml | 2 +- .github/workflows/build_swagger.yml | 2 +- .github/workflows/save-and-restore-docker-image.yml | 4 ++-- README.md | 13 +++++++------ app/alarm/audio-annunciator/pom.xml | 4 ++-- app/alarm/freetts-annunciator/pom.xml | 4 ++-- app/display/actions/pom.xml | 4 ++-- app/save-and-restore/util/pom.xml | 4 ++-- app/trends/archive-datasource/pom.xml | 4 ++-- app/trends/archive-reader/pom.xml | 4 ++-- pom.xml | 8 ++++---- services/save-and-restore/README.md | 3 ++- services/save-and-restore/doc/index.rst | 3 ++- 16 files changed, 38 insertions(+), 35 deletions(-) diff --git a/.github/workflows/alarm-logger-docker-image.yml b/.github/workflows/alarm-logger-docker-image.yml index 2641320193..1e872f5b62 100644 --- a/.github/workflows/alarm-logger-docker-image.yml +++ b/.github/workflows/alarm-logger-docker-image.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Maven and Java Action uses: s4u/setup-maven-action@v1.18.0 with: - java-version: '17' + java-version: '21' maven-version: '3.9.6' - name: Build run: mvn --batch-mode install -DskipTests @@ -30,10 +30,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/.github/workflows/alarm-server-docker-image.yml b/.github/workflows/alarm-server-docker-image.yml index a304971639..44b90a3c62 100644 --- a/.github/workflows/alarm-server-docker-image.yml +++ b/.github/workflows/alarm-server-docker-image.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Maven and Java Action uses: s4u/setup-maven-action@v1.18.0 with: - java-version: '17' + java-version: '21' maven-version: '3.9.6' - name: Build run: mvn --batch-mode install -DskipTests @@ -30,10 +30,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b1e890f3d..00ee599c99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - name: Setup Maven and Java Action uses: s4u/setup-maven-action@v1.18.0 with: - java-version: '17' + java-version: '21' maven-version: '3.9.6' - name: Build run: mvn --batch-mode install -DskipTests \ No newline at end of file diff --git a/.github/workflows/build_latest.yml b/.github/workflows/build_latest.yml index 6d39ae0918..72bc62f3be 100644 --- a/.github/workflows/build_latest.yml +++ b/.github/workflows/build_latest.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Maven and Java Action uses: s4u/setup-maven-action@v1.18.0 with: - java-version: '17' + java-version: '21' maven-version: '3.9.6' - name: Build run: mvn --batch-mode install -DskipTests diff --git a/.github/workflows/build_swagger.yml b/.github/workflows/build_swagger.yml index 3d2f764132..44ad301ac4 100644 --- a/.github/workflows/build_swagger.yml +++ b/.github/workflows/build_swagger.yml @@ -14,7 +14,7 @@ jobs: - name: Setup Maven and Java Action uses: s4u/setup-maven-action@v1.18.0 with: - java-version: '17' + java-version: '21' maven-version: '3.9.6' - name: Get swagger.json run: | diff --git a/.github/workflows/save-and-restore-docker-image.yml b/.github/workflows/save-and-restore-docker-image.yml index 0a3f1cc6bc..239f06b1fc 100644 --- a/.github/workflows/save-and-restore-docker-image.yml +++ b/.github/workflows/save-and-restore-docker-image.yml @@ -19,10 +19,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/README.md b/README.md index 22cc6c8e17..22f057cd9e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ https://control-system-studio.readthedocs.io ## Requirements - - [JDK17 or later, suggested is OpenJDK](https://adoptium.net/en-GB/temurin/archive/?version=17). + - [JDK21 or later, suggested is OpenJDK](https://adoptium.net/en-GB/temurin/archive/?version=21). - [maven 3.x](https://maven.apache.org/) or [ant](http://ant.apache.org/) @@ -27,7 +27,7 @@ mvn clean verify -f dependencies/pom.xml Define the JAVA_HOME environment variable to point to your Java installation directory. Mac OS users should use something like: ``` -export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.10+7/Contents/Home +export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-21.0.10+7/Contents/Home ``` Verify through: ``` @@ -73,13 +73,13 @@ Download "Eclipse for Java Developers" from https://www.eclipse.org/downloads/pa Start Eclipse like this: - export JAVA_HOME=/path/to/your/jdk-17-or-later + export JAVA_HOME=/path/to/your/jdk-21-or-later export PATH="$JAVA_HOME/bin:$PATH" eclipse/eclipse -consoleLog Check Eclipse Preferences: - * Java, Installed JREs: JDK 17-or-later should be the default + * Java, Installed JREs: JDK 21-or-later should be the default * Java, Compiler: JDK Compliance should be "9" or higher @@ -112,7 +112,8 @@ In Help/Eclipse Marketplace, search for Maven Integration for Eclipse Luna or ne Use File/Import/Maven/Existing Maven Projects to import the phoebus source code. There can be a compiler error because the "JRE System Library" in the Package Explorer shows "[J2SE-1.4]". -Right click on the affected projects (greeting-app, probe), Build Path, Configure Build Path, Libraries, Edit the JRE System Library to use the Workspace default (jdk-17). +Right click on the affected projects (greeting-app, probe), Build Path, +Configure Build Path, Libraries, Edit the JRE System Library to use the Workspace default (jdk-21). Restart Eclipse IDE. Can now start product/src/main/java/org.phoebus.product/Launcher.java. @@ -133,7 +134,7 @@ To run the Phoebus application: * Run | Edit Configurations... * Select + | Application -* Module: Your JRE 17 +* Module: Your JRE 21 * Classpath `-cp`: select `product` from drop-down * Main class: `org.phoebus.product.Launcher` * Set the name to Phoebus diff --git a/app/alarm/audio-annunciator/pom.xml b/app/alarm/audio-annunciator/pom.xml index 085313f76a..52466fa955 100644 --- a/app/alarm/audio-annunciator/pom.xml +++ b/app/alarm/audio-annunciator/pom.xml @@ -11,8 +11,8 @@ app-alarm-audio-annunciator - 17 - 17 + 21 + 21 diff --git a/app/alarm/freetts-annunciator/pom.xml b/app/alarm/freetts-annunciator/pom.xml index 58b9bbd018..9720465e6e 100644 --- a/app/alarm/freetts-annunciator/pom.xml +++ b/app/alarm/freetts-annunciator/pom.xml @@ -11,8 +11,8 @@ app-alarm-freetts-annunciator - 17 - 17 + 21 + 21 diff --git a/app/display/actions/pom.xml b/app/display/actions/pom.xml index 6fe4c3a7c8..42882c66d8 100644 --- a/app/display/actions/pom.xml +++ b/app/display/actions/pom.xml @@ -16,8 +16,8 @@ app-display-actions - 17 - 17 + 21 + 21 UTF-8 diff --git a/app/save-and-restore/util/pom.xml b/app/save-and-restore/util/pom.xml index f7083fcdf3..d83f37a22d 100644 --- a/app/save-and-restore/util/pom.xml +++ b/app/save-and-restore/util/pom.xml @@ -12,8 +12,8 @@ save-and-restore-util - 17 - 17 + 21 + 21 diff --git a/app/trends/archive-datasource/pom.xml b/app/trends/archive-datasource/pom.xml index 988864edd9..459080208a 100644 --- a/app/trends/archive-datasource/pom.xml +++ b/app/trends/archive-datasource/pom.xml @@ -11,8 +11,8 @@ app-trends-archive-datasource - 17 - 17 + 21 + 21 diff --git a/app/trends/archive-reader/pom.xml b/app/trends/archive-reader/pom.xml index 21ce6b584f..fae8bb7959 100644 --- a/app/trends/archive-reader/pom.xml +++ b/app/trends/archive-reader/pom.xml @@ -12,8 +12,8 @@ app-trends-archive-reader - 17 - 17 + 21 + 21 diff --git a/pom.xml b/pom.xml index 06fbdab18d..1ec0204d00 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 10.16.1.1 2.7.4b1 6.9.0.202403050737-r - 17 + 21 5.18.4 1.26.1 @@ -101,8 +101,8 @@ maven-compiler-plugin 3.6.2 - 17 - 17 + 21 + 21 true -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED @@ -283,7 +283,7 @@ none - 17 + 21 diff --git a/services/save-and-restore/README.md b/services/save-and-restore/README.md index 7676e323c7..cd0c6bf1c4 100644 --- a/services/save-and-restore/README.md +++ b/services/save-and-restore/README.md @@ -4,7 +4,8 @@ The save-and-restore service implements service as a collection of REST endpoints. These can be used by clients to manage configurations (aka save sets) and snapshots, to compare snapshots and to restore PV values from snapshots. -The service is packaged as a self-contained Spring Boot jar file. External dependencies are limited to a JVM (Java 17+) +The service is packaged as a self-contained Spring Boot jar file. +External dependencies are limited to a JVM (Java 21+) and a running instance of Elasticsearch (8.x). # Build diff --git a/services/save-and-restore/doc/index.rst b/services/save-and-restore/doc/index.rst index 7e3990224a..af5d39aad2 100644 --- a/services/save-and-restore/doc/index.rst +++ b/services/save-and-restore/doc/index.rst @@ -5,7 +5,8 @@ The save-and-restore service implements service as a collection of REST endpoints. These can be used by clients to manage configurations (aka save sets) and snapshots, to compare snapshots and to restore PV values from snapshots. -The service is packaged as a self-contained Spring Boot jar file. External dependencies are limited to a JVM (Java 17+) +The service is packaged as a self-contained Spring Boot jar file. +External dependencies are limited to a JVM (Java 21+) and a running instance of Elasticsearch (8.x). Running the service