Use the --release flag for java compilation

This gets around the documented issue from java 9 and later where simply
using -source and -target might result in newer APIs still getting used
anyway. This version will ensure the compiled classes work on the
intended version.

This also fixes a warning that javac printed.
This commit is contained in:
Joshua Suskalo 2024-10-18 11:24:36 -04:00
parent 50dca53b7d
commit 39dc48b9e9
No known key found for this signature in database
GPG key ID: 9B6BA586EFF1B9F0

View file

@ -53,8 +53,7 @@
(b/process {:command-args ["javac" (b/process {:command-args ["javac"
"src/java/coffi/ffi/Loader.java" "src/java/coffi/ffi/Loader.java"
"-d" class-dir "-d" class-dir
"-target" "22" "--release" "22"]})]
"-source" "22"]})]
(when-not (zero? (:exit compilation-result)) (when-not (zero? (:exit compilation-result))
(b/delete {:path class-dir}))) (b/delete {:path class-dir})))
opts) opts)