I've have a Groovy project built with Gradle (1.8) in which some Java classes report the following compiler warning message:
warning: Unsafe is internal proprietary API and may be removed in a future release
import sun.misc.Unsafe;
Is there a way to suppress that error message? I've found some answers suggesting to use the javac compiler option -XDignore.symbol.file
but I'm unable to apply it in the Gradle build when using the Groovy plugin.
Any solution ?
Thanks
Add following to your gradle.build file
compileJava {
options.compilerArgs << '-XDignore.symbol.file'
options.fork = true // may not needed on 1.8
options.forkOptions.executable = 'javac' // may not needed on 1.8
}
fork is required on gradle 1.6, not sure about 1.8 update: it's still required on 1.8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With