Skip to content

Commit d39e5a5

Browse files
committed
Update Java version to 25 across all starter templates and solutions, enabling preview features in the build configuration and scripts.
1 parent f2aaf90 commit d39e5a5

File tree

15 files changed

+74
-25
lines changed

15 files changed

+74
-25
lines changed

compiled_starters/java/.codecrafters/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
exec java -jar /tmp/codecrafters-build-redis-java/codecrafters-redis.jar "$@"
11+
exec java --enable-preview -jar /tmp/codecrafters-build-redis-java/codecrafters-redis.jar "$@"

compiled_starters/java/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the Java version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: java-24
11-
buildpack: java-24
10+
# Available versions: java-25
11+
buildpack: java-25

compiled_starters/java/pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,23 @@
99
<version>1.0</version>
1010

1111
<properties>
12-
<maven.compiler.source>23</maven.compiler.source>
13-
<maven.compiler.target>23</maven.compiler.target>
12+
<maven.compiler.source>25</maven.compiler.source>
13+
<maven.compiler.target>25</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<java.version>23</java.version>
15+
<java.version>25</java.version>
1616
</properties>
1717

1818
<build>
1919
<plugins>
20+
<plugin>
21+
<groupId>org.apache.maven.plugins</groupId>
22+
<artifactId>maven-compiler-plugin</artifactId>
23+
<configuration>
24+
<compilerArgs>
25+
<arg>--enable-preview</arg>
26+
</compilerArgs>
27+
</configuration>
28+
</plugin>
2029
<plugin>
2130
<groupId>org.apache.maven.plugins</groupId>
2231
<artifactId>maven-assembly-plugin</artifactId>

compiled_starters/java/your_program.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
2121
#
2222
# - Edit this to change how your program runs locally
2323
# - Edit .codecrafters/run.sh to change how your program runs remotely
24-
exec java -jar /tmp/codecrafters-build-redis-java/codecrafters-redis.jar "$@"
24+
exec java --enable-preview -jar /tmp/codecrafters-build-redis-java/codecrafters-redis.jar "$@"

dockerfiles/java-25.Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
FROM maven:3.9.11-eclipse-temurin-25-alpine
3+
4+
# Ensures the container is re-built if dependency files change
5+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="pom.xml"
6+
7+
WORKDIR /app
8+
9+
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
10+
COPY --exclude=.git --exclude=README.md . /app
11+
12+
# Install language-specific dependencies
13+
RUN .codecrafters/compile.sh

solutions/java/01-jm1/code/.codecrafters/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
exec java -jar /tmp/codecrafters-build-redis-java/codecrafters-redis.jar "$@"
11+
exec java --enable-preview -jar /tmp/codecrafters-build-redis-java/codecrafters-redis.jar "$@"

solutions/java/01-jm1/code/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the Java version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: java-24
11-
buildpack: java-24
10+
# Available versions: java-25
11+
buildpack: java-25

solutions/java/01-jm1/code/pom.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,23 @@
99
<version>1.0</version>
1010

1111
<properties>
12-
<maven.compiler.source>23</maven.compiler.source>
13-
<maven.compiler.target>23</maven.compiler.target>
12+
<maven.compiler.source>25</maven.compiler.source>
13+
<maven.compiler.target>25</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<java.version>23</java.version>
15+
<java.version>25</java.version>
1616
</properties>
1717

1818
<build>
1919
<plugins>
20+
<plugin>
21+
<groupId>org.apache.maven.plugins</groupId>
22+
<artifactId>maven-compiler-plugin</artifactId>
23+
<configuration>
24+
<compilerArgs>
25+
<arg>--enable-preview</arg>
26+
</compilerArgs>
27+
</configuration>
28+
</plugin>
2029
<plugin>
2130
<groupId>org.apache.maven.plugins</groupId>
2231
<artifactId>maven-assembly-plugin</artifactId>

solutions/java/01-jm1/code/your_program.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
2121
#
2222
# - Edit this to change how your program runs locally
2323
# - Edit .codecrafters/run.sh to change how your program runs remotely
24-
exec java -jar /tmp/codecrafters-build-redis-java/codecrafters-redis.jar "$@"
24+
exec java --enable-preview -jar /tmp/codecrafters-build-redis-java/codecrafters-redis.jar "$@"

solutions/java/02-rg2/code/.codecrafters/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
exec java -jar /tmp/codecrafters-build-redis-java/codecrafters-redis.jar "$@"
11+
exec java --enable-preview -jar /tmp/codecrafters-build-redis-java/codecrafters-redis.jar "$@"

0 commit comments

Comments
 (0)