jshell-maven-plugin icon indicating copy to clipboard operation
jshell-maven-plugin copied to clipboard

Specify minimum JDK version

Open cfries opened this issue 4 years ago • 1 comments

Maybe it can already be done - I am not sure - but it would be nice to be able to specify a minimum JDK version, such that, if I run mvn jshell:run from a JDK 10 and it was required to use JDK 11 (because my project specified that in the complier plugin in), then JShell will not start and issues a nice error message "Minimum JDK version is 11. You tried to launch with version 10. Please run from version 11 or better."

cfries avatar Jun 10 '20 16:06 cfries

I just hit the same issue, while trying to use jshell-maven-plugin in a project that still requires Java 8 to compile

[ERROR] Failed to execute goal com.github.johnpoth:jshell-maven-plugin:1.2:run (default-cli) on project keycloak-bom-parent: 
Execution default-cli of goal com.github.johnpoth:jshell-maven-plugin:1.2:run failed: Unable to load the mojo 'run' in the plugin 'com.github.johnpoth:jshell-maven-plugin:1.2' due to an API incompatibility: 
org.codehaus.plexus.component.repository.exception.ComponentLookupException: 
com/github/johnpoth/jshell/JShellMojo has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Is the Java 11 minimum requirement really necessary? Perhaps you could use jabel to compile the plugin to be used with versions older than JDK 11, even JDK 8.

thomasdarimont avatar Oct 16 '20 07:10 thomasdarimont