Skip to content

Update to java 21 #3350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/alarm-logger-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Maven and Java Action
uses: s4u/[email protected]
with:
java-version: '17'
java-version: '21'
maven-version: '3.9.6'
- name: Build
run: mvn --batch-mode install -DskipTests
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/alarm-server-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Maven and Java Action
uses: s4u/[email protected]
with:
java-version: '17'
java-version: '21'
maven-version: '3.9.6'
- name: Build
run: mvn --batch-mode install -DskipTests
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Maven and Java Action
uses: s4u/[email protected]
with:
java-version: '17'
java-version: '21'
maven-version: '3.9.6'
- name: Build
run: mvn --batch-mode install -DskipTests
2 changes: 1 addition & 1 deletion .github/workflows/build_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Maven and Java Action
uses: s4u/[email protected]
with:
java-version: '17'
java-version: '21'
maven-version: '3.9.6'
- name: Build
run: mvn --batch-mode install -DskipTests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Maven and Java Action
uses: s4u/[email protected]
with:
java-version: '17'
java-version: '21'
maven-version: '3.9.6'
- name: Get swagger.json
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/save-and-restore-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)


Expand All @@ -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:
```
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/alarm/audio-annunciator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<artifactId>app-alarm-audio-annunciator</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions app/alarm/freetts-annunciator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<artifactId>app-alarm-freetts-annunciator</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions app/display/actions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<artifactId>app-display-actions</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions app/save-and-restore/util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<artifactId>save-and-restore-util</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions app/trends/archive-datasource/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<artifactId>app-trends-archive-datasource</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions app/trends/archive-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<artifactId>app-trends-archive-reader</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>

<dependencies>
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<derby.version>10.16.1.1</derby.version>
<jython.version>2.7.4b1</jython.version>
<jgit.version>6.9.0.202403050737-r</jgit.version>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.target>21</maven.compiler.target>
<activemq.client.version>5.18.4</activemq.client.version>
<commons.compress.version>1.26.1</commons.compress.version>
<!--suppress UnresolvedMavenProperty -->
Expand All @@ -101,8 +101,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.2</version>
<configuration>
<source>17</source>
<target>17</target>
<source>21</source>
<target>21</target>
<fork>true</fork>
<compilerArgs>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
Expand Down Expand Up @@ -283,7 +283,7 @@
<configuration>
<!-- add this to disable checking -->
<doclint>none</doclint>
<source>17</source>
<source>21</source>
</configuration>
</execution>
</executions>
Expand Down
3 changes: 2 additions & 1 deletion services/save-and-restore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion services/save-and-restore/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading