33# version. It assumes that `coursier` is available on the `$PATH` and that the
44# `scip-java` binary is already installed at `/app/scip-java/bin/scip-java`.
55set -eu
6- JVM_VERSION=" ${JVM_VERSION:- 17} "
6+ JVM_VERSION=" ${JVM_VERSION:- 17,11,8 } "
77FILE=" $PWD /lsif-java.json"
88if test -f " $FILE " ; then
99 FROM_CONFIG=$( jq -r ' .jvm' " $FILE " )
@@ -12,13 +12,33 @@ if test -f "$FILE"; then
1212 fi
1313fi
1414
15- echo " Using JVM version ' $JVM_VERSION ' "
15+ JVM_VERSIONS= $( echo $JVM_VERSION | tr " , " " \n " )
1616
17- if [ " $JVM_VERSION " = " 17" ]; then
18- export JAVA_OPTS=" --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
19- # No need to download Java 17 because it's pre-installed.
20- else
21- eval " $( coursier java --jvm " $JVM_VERSION " --env --jvm-index https://github.com/coursier/jvm-index/blob/master/index.json) "
22- fi
17+ LAST_CODE=" -1"
18+
19+ ARGS=$@
20+
21+ for JVM_VERSION in $JVM_VERSIONS
22+ do
23+ if [ " $LAST_CODE " != " 0" ]; then
24+ echo " Using JVM version '$JVM_VERSION '"
25+
26+ if [ " $JVM_VERSION " = " 17" ]; then
27+ export JAVA_OPTS=" --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
28+ else
29+ export JAVA_OPTS=" "
30+ fi
31+
32+ eval " $( coursier java --jvm " $JVM_VERSION " --env --jvm-index https://github.com/coursier/jvm-index/blob/master/index.json) "
33+
34+ java -version
35+ if /app/scip-java/bin/scip-java " $@ " ; then
36+ LAST_CODE=" 0"
37+ else
38+ LAST_CODE=$?
39+ fi
40+
41+ fi
42+ done
2343
24- /app/scip-java/bin/scip-java " $@ "
44+ exit $LAST_CODE
0 commit comments