Skip to content

Commit

Permalink
updated java to version 24
Browse files Browse the repository at this point in the history
  • Loading branch information
polischuks committed Sep 10, 2024
1 parent 693334c commit 3c87301
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
24 changes: 24 additions & 0 deletions epicbox-java/24/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM openjdk:24-slim

ARG GSON_LIB_URL=https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar
ARG JAVAX_JSON_API_LIB_URL=https://repo1.maven.org/maven2/javax/json/javax.json-api/1.1.4/javax.json-api-1.1.4.jar
ARG JAVAX_JSON_LIB_URL=https://repo1.maven.org/maven2/org/glassfish/javax.json/1.1.4/javax.json-1.1.4.jar
ARG JSON_SIMPLE_LIB_URL=https://repo1.maven.org/maven2/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar

ARG JAVA_LIB_PATH=/usr/local/lib/java

ENV CLASSPATH=.:$JAVA_LIB_PATH/*

RUN mkdir -p $JAVA_LIB_PATH

ADD $GSON_LIB_URL $JAVA_LIB_PATH
ADD $JAVAX_JSON_API_LIB_URL $JAVA_LIB_PATH
ADD $JAVAX_JSON_LIB_URL $JAVA_LIB_PATH
ADD $JSON_SIMPLE_LIB_URL $JAVA_LIB_PATH

RUN chmod og+r $JAVA_LIB_PATH/*

COPY java_lookup_main.sh /usr/local/bin/java_lookup_main.sh
RUN chmod +x /usr/local/bin/java_lookup_main.sh

RUN useradd -M -d /sandbox sandbox
15 changes: 15 additions & 0 deletions epicbox-java/24/java_lookup_main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# Grep *.class files in the given directory to find one with psvm method defined
# Usage: java_lookup_main.sh DIRECTORY_PATH

PSVM_REGEX="public static( final)? void main\(java\.lang\.String(\[\]|\.\.\.)\)"

shopt -s nullglob
for f in "$1"/*.class; do
if javap -p "$f" 2> /dev/null | grep -Pq "$PSVM_REGEX"; then
filename=$(basename "$f")
echo -n "${filename%.*}"
exit 0
fi
done
exit 1
2 changes: 1 addition & 1 deletion epicbox-kotlin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:18.0.2-slim
FROM openjdk:24-slim

ARG COMPILER_URL=https://github.com/JetBrains/kotlin/releases/download/v2.0.0/kotlin-compiler-2.0.0.zip
ARG KOTLINX_ATOMICFU_JVM_URL=https://repo1.maven.org/maven2/org/jetbrains/kotlinx/atomicfu-jvm/0.25.0/atomicfu-jvm-0.25.0.jar
Expand Down

0 comments on commit 3c87301

Please sign in to comment.