Description
Currently the jextract-swift
section of the USER_GUIDE
tells us that it needs JDK 22 to utilise "Project Panama".
Upon further inspection, I realised that the Java2Swift
Program doesn't compile at all if the JDK version is lesser than 21. This is due to the fact that we hardcoded the vmArgs.version
to JNI_VERSION_21
while instantiating a JavaVirtualMachine
object.
This JNI_VERSION_21
is a preprocessor constant which is only available in JDK 21 or later.
If this is the intended behaviour, It will be better to update the USER_GUIDE
to let people know that Java2Swift
will need a JDK that is 21 or later. However, if this is not the intended behaviour, then replacing the hardcoded JNI version with a JNI version which corresponds to the user's JDK would be better.
I'm not an expert in this context, but making an assumption that a lot of current enterprises (who would like to move their tech stack from JVM to Swift) need not be running their software in JDK 21 or later would be more realistic. Thus, I believe trying to support older JDKs instead of supporting only JDK 21 or later (unless mandatory such as "Project Panama") will be better for this project. Feel free to correct me if I'm wrong.
Edit: Realised the gradle files also specify JDK 22 to be a requirement.