I’ve been using the application plugin for an app written in Groovy. It initially targeted JDK 8, but now I want it to run it on JDK 11 as well.
The problem is that when you run Groovy 2.5 and JDK 11, you will get warnings like this:
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/home/bob/projects/mvi-all/m/lib/groovy-2.5.8.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int) WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
These can be suppressed by adding a shed-ton of JVM options like this:
I was able to get JDK 11 working quietly with the
defaultJvmOpts property of
CreateStartScripts; however, JDK 8 doesn’t know about these options, so it will break.
Is there any other way to get this working with the default CreateStartScripts task, or do I have to make my own custom template? I can’t see any way around it since I have to add a test for JDK and some conditional logic…then I gotta do it for .sh and .bat