Skip to content

Commit bac40b9

Browse files
committed
Use java 25 almost everywhere to remove no longer used workaround
Before java 11 was used for most examples, but for maven to run also java 17 was used.
1 parent 4e8a012 commit bac40b9

File tree

45 files changed

+101
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+101
-463
lines changed

.envrc-template

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,14 @@
1010
# Note: This file contains the minimal environment variables needed to run the examples.
1111
# For more configuration options, see jigsaw-examples/env.sh
1212
#
13+
# todo: is this still true, or does it rather automatically configure JDK 25.0.1
1314
# SDKMAN Users: If you use SDKMAN with sdkman_auto_env=true, the .sdkmanrc file
1415
# will automatically configure JDK 11.0.28. This may interfere with JAVA_HOME
1516
# settings below. Either disable sdkman_auto_env or ensure paths match.
1617

17-
# Path to JDK 17 or later (required for example_gradle-project with Gradle 9.x)
18-
export JAVA17_HOME=/path/to/jdk17
19-
20-
# Path to JDK 9, 10, or 11 (required for most examples, JDK 17 is also fine)
21-
# Strongly recommended: JDK 11.0.28 (Temurin) - cf. README
22-
export JAVA_HOME=/path/to/java9-or-10-or-11-jdk
23-
24-
# Path to JDK 11 specifically (required for examples that need JDK 11)
25-
# Strongly recommended: JDK 11.0.28 (Temurin) - cf. README
26-
export JAVA11_HOME=/path/to/java11-jdk
18+
# Path to JDK 25 (required for most examples)
19+
# Strongly recommended: JDK 25.0.1 (Temurin) - cf. README
20+
export JAVA_HOME=/path/to/java25-jdk
2721

2822
# Path to JDK 8 (only needed for example_compile-target-jdk8)
2923
# If you want to explicitly test with JDK 8

jigsaw-examples/env.sh

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,14 @@ set -eu -o pipefail
55

66
# configure paths here
77

8-
# Path to JDK9 or JDK10 (9.0.1, 9.0.4 and 10_18.3_10+46 have been tested)
9-
# Recommended: JDK 11.0.28 (Temurin) - same as CI/CD pipeline
10-
# SDKMAN Users: .sdkmanrc at repository root configures JDK 11.0.28 automatically
11-
[ -z "${JAVA_HOME:-}" ] && export JAVA_HOME=TODO/path/to/java9-or-10-jdk/goes/here
8+
# Path to JDK25
9+
# Recommended: JDK 25.0.1 (Temurin) - same as CI/CD pipeline
10+
# SDKMAN Users: .sdkmanrc at repository root configures JDK 25.0.1 automatically
11+
[ -z "${JAVA_HOME:-}" ] && export JAVA_HOME=TODO/path/to/java25-jdk/goes/here
1212

1313
# Path to JDK8, only needed in example_compile-target-jdk8 (and special profile in example_spring-hibernate)
1414
[ -z "${JAVA8_HOME:-}" ] && export JAVA8_HOME=TODO/path/to/java8-jdk/goes/here
1515

16-
# Path to JDK11, only needed for specific examples (e.g., example_version/m4 runtime)
17-
[ -z "${JAVA11_HOME:-}" ] && export JAVA11_HOME=TODO/path/to/java11-jdk/goes/here
18-
19-
# Path to JDK17, only needed in example_gradle-project and Maven 4 builds
20-
[ -z "${JAVA17_HOME:-}" ] && export JAVA17_HOME=TODO/path/to/java17-jdk/goes/here
21-
2216
# Path to Eclipse (legacy compatibility, not recommended for new work)
2317
[ -z "${ECLIPSE_HOME:-}" ] && export ECLIPSE_HOME=TODO/path/to/eclipse/goes/here
2418

jigsaw-examples/example_addExports_manifest/m4/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mvn --version
2727
echo
2828

2929
echo "mvn clean compile"
30-
echo "(Maven runs with JDK 17, targets Java 11 via maven.compiler.source/target)"
30+
echo "(Maven runs with JDK 17+, targets Java 25 via maven.compiler.source/target)"
3131
mvn clean compile
3232

3333
# Create JARs directly to mlib (similar to original compile.sh)

jigsaw-examples/example_addExports_manifest/m4/run.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,24 @@ set -eu -o pipefail
44
# shellcheck source=../../env.sh
55
source ../../env.sh
66

7-
# Use JDK 11 for runtime (required to access JDK 11 internals)
8-
if [ -z "${JAVA11_HOME:-}" ]; then
9-
echo "ERROR: JAVA11_HOME is not set. This example requires JDK 11 to run."
10-
exit 1
11-
fi
12-
137
# Show Java version for user information
148
echo "Using Java version:"
15-
"${JAVA11_HOME}/bin/java" -version
9+
"${JAVA_HOME}/bin/java" -version
1610
echo
1711

1812
# Create run-result directory if it doesn't exist
1913
mkdir -p run-result
2014

2115
# First run: Allow access to moda without using the "Add-Exports" entry from MANIFEST.MF
2216
# shellcheck disable=SC2086 # JAVA_OPTIONS is intentionally unquoted for word splitting
23-
"${JAVA11_HOME}/bin/java" ${JAVA_OPTIONS} \
17+
"${JAVA_HOME}/bin/java" ${JAVA_OPTIONS} \
2418
--add-exports java.base/jdk.internal.org.xml.sax=modmain \
2519
--add-exports moda/pkgainternal=modmain \
2620
--module-path mlib --module modmain/pkgmain.Main 2>&1 | normalize | tee run-result/run.txt | myecho
2721

2822
# Second run: Allow access to moda with using the "Add-Exports" entry from MANIFEST.MF
2923
# shellcheck disable=SC2086 # JAVA_OPTIONS is intentionally unquoted for word splitting
30-
"${JAVA11_HOME}/bin/java" ${JAVA_OPTIONS} \
24+
"${JAVA_HOME}/bin/java" ${JAVA_OPTIONS} \
3125
--add-modules moda \
3226
--module-path mlib \
3327
-jar mlib/modmain.jar 2>&1 | normalize | tee -a run-result/run.txt | myecho

jigsaw-examples/example_addReads_addExports/m4/compile.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ if [ -z "${M4_HOME:-}" ]; then
1010
exit 1
1111
fi
1212

13-
# Maven 4 requires Java 17+ to run
14-
# Note: pom.xml has <maven.compiler.release>11</maven.compiler.release> which ensures
15-
# Java 11 compatible bytecode even when using JDK 17 compiler with --release 11
16-
if [ -n "${JAVA17_HOME:-}" ]; then
17-
export JAVA_HOME="${JAVA17_HOME}"
18-
fi
19-
2013
# Add Maven 4 to PATH
2114
export PATH="${M4_HOME}/bin:${PATH}"
2215

@@ -27,7 +20,7 @@ mvn --version
2720
echo
2821

2922
echo "mvn clean compile"
30-
echo "(Maven runs with JDK 17, compiles for Java 11 via maven.compiler.release)"
23+
echo "(Maven runs with JDK 17+, compiles for Java 25 via maven.compiler.release)"
3124
mvn clean compile
3225

3326
# Create JARs directly to mlib (similar to original compile.sh)

jigsaw-examples/example_addReads_addExports_reflection/m4/compile.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ if [ -z "${M4_HOME:-}" ]; then
1010
exit 1
1111
fi
1212

13-
# Maven 4 requires Java 17+ to run
14-
# Note: pom.xml has <maven.compiler.release>11</maven.compiler.release> which ensures
15-
# Java 11 compatible bytecode even when using JDK 17 compiler with --release 11
16-
if [ -n "${JAVA17_HOME:-}" ]; then
17-
export JAVA_HOME="${JAVA17_HOME}"
18-
fi
19-
2013
# Add Maven 4 to PATH
2114
export PATH="${M4_HOME}/bin:${PATH}"
2215

@@ -27,7 +20,7 @@ mvn --version
2720
echo
2821

2922
echo "mvn clean compile"
30-
echo "(Maven runs with JDK 17, compiles for Java 11 via maven.compiler.release)"
23+
echo "(Maven runs with JDK 17+, compiles for Java 25 via maven.compiler.release)"
3124
mvn clean compile
3225

3326
# Create JARs directly to mlib (similar to original compile.sh)

jigsaw-examples/example_annotations/m4/compile.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ if [ -z "${M4_HOME:-}" ]; then
1010
exit 1
1111
fi
1212

13-
# Maven 4 requires Java 17+ to run
14-
# Note: pom.xml has <maven.compiler.release>11</maven.compiler.release> which ensures
15-
# Java 11 compatible bytecode even when using JDK 17 compiler with --release 11
16-
if [ -n "${JAVA17_HOME:-}" ]; then
17-
export JAVA_HOME="${JAVA17_HOME}"
18-
fi
19-
2013
# Add Maven 4 to PATH
2114
export PATH="${M4_HOME}/bin:${PATH}"
2215

@@ -27,7 +20,7 @@ mvn --version
2720
echo
2821

2922
echo "mvn clean compile"
30-
echo "(Maven runs with JDK 17, compiles for Java 11 via maven.compiler.release)"
23+
echo "(Maven runs with JDK 17+, compiles for Java 25 via maven.compiler.release)"
3124
mvn clean compile
3225

3326
# Create JARs directly to mlib (similar to original compile.sh)

jigsaw-examples/example_automatic-module-logging/m4/compile.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ if [ -z "${M4_HOME:-}" ]; then
1010
exit 1
1111
fi
1212

13-
# Maven 4 requires Java 17+ to run
14-
# Note: pom.xml has <maven.compiler.release>11</maven.compiler.release> which ensures
15-
# Java 11 compatible bytecode even when using JDK 17 compiler with --release 11
16-
if [ -n "${JAVA17_HOME:-}" ]; then
17-
export JAVA_HOME="${JAVA17_HOME}"
18-
fi
19-
2013
# Add Maven 4 to PATH
2114
export PATH="${M4_HOME}/bin:${PATH}"
2215

@@ -27,7 +20,7 @@ mvn --version
2720
echo
2821

2922
echo "mvn clean compile"
30-
echo "(Maven runs with JDK 17, compiles for Java 11 via maven.compiler.release)"
23+
echo "(Maven runs with JDK 17+, compiles for Java 25 via maven.compiler.release)"
3124
mvn clean compile
3225

3326
# Create JARs directly to mlib (similar to original compile.sh)

jigsaw-examples/example_derived_private-package-protected/m4/compile.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ if [ -z "${M4_HOME:-}" ]; then
1010
exit 1
1111
fi
1212

13-
# Maven 4 requires Java 17+ to run
14-
# Note: pom.xml has <maven.compiler.release>11</maven.compiler.release> which ensures
15-
# Java 11 compatible bytecode even when using JDK 17 compiler with --release 11
16-
if [ -n "${JAVA17_HOME:-}" ]; then
17-
export JAVA_HOME="${JAVA17_HOME}"
18-
fi
19-
2013
# Add Maven 4 to PATH
2114
export PATH="${M4_HOME}/bin:${PATH}"
2215

@@ -27,7 +20,7 @@ mvn --version
2720
echo
2821

2922
echo "mvn clean compile"
30-
echo "(Maven runs with JDK 17, compiles for Java 11 via maven.compiler.release)"
23+
echo "(Maven runs with JDK 17+, compiles for Java 25 via maven.compiler.release)"
3124
mvn clean compile
3225

3326
# Create JARs directly to mlib (similar to original compile.sh)

jigsaw-examples/example_exceptions/m4/compile.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ if [ -z "${M4_HOME:-}" ]; then
1010
exit 1
1111
fi
1212

13-
# Maven 4 requires Java 17+ to run
14-
# Note: pom.xml has <maven.compiler.release>11</maven.compiler.release> which ensures
15-
# Java 11 compatible bytecode even when using JDK 17 compiler with --release 11
16-
if [ -n "${JAVA17_HOME:-}" ]; then
17-
export JAVA_HOME="${JAVA17_HOME}"
18-
fi
19-
2013
# Add Maven 4 to PATH
2114
export PATH="${M4_HOME}/bin:${PATH}"
2215

@@ -27,7 +20,7 @@ mvn --version
2720
echo
2821

2922
echo "mvn clean compile"
30-
echo "(Maven runs with JDK 17, compiles for Java 11 via maven.compiler.release)"
23+
echo "(Maven runs with JDK 17+, compiles for Java 25 via maven.compiler.release)"
3124
mvn clean compile
3225

3326
# Create JARs directly to mlib (similar to original compile.sh)

0 commit comments

Comments
 (0)