Open Katrix opened 3 years ago
When trying to suggest the modules, the plugin calls ModuleDescriptor.read(InputStream in), where the InputStream argument provides the content of a module-info.class
compiled with Java 15. But the plugin runs with the Java version used to invoke Gradle, which in your case is 11. That's why you get the exception "Unsupported major.minor version 59.0".
I will provide a fix in the next few days, but at the moment I don't know what is the best way to tackle this issue. My current idea is that the plugin could fork a Java 15 process that executes the required ModuleDescriptor.read() operations. However, I'm not very happy with this solution, so I would be grateful for any suggestions.
@Katrix I added support for the toolchain in 1.12.2. You no longer need the java15home
, because javaHome and jpackageHome are now configured by default with the value from toolchain
.
Running most of my build script with a newer java version than what I'm invoking Gradle with (JAVA_HOME points to 11) using the new toolchains feature.
Within my build, I set the toolchain version to 15. I also set the runtime plugin to use this compiler as it's
javaHome
andjpackageHome
.When I try to then run
./gradlew jpackage
, it fails. This is the exception causeIt seems like it doesn't like the newer Java home when trying to discover used modules.
Running
./gradlew suggestModules
using a JAVA_HOME with JDK 15 and pasting in what it suggests in the build script gets around the issue when JAVA_HOME no longer points to JDK 15.