zak
(zak guler)
January 20, 2016, 10:24pm
1
I am new to gradle and trying to compiling java swing projects and getting lots of warning messages:
…\ReportManager.java:395: warning: XML11Serializer is internal proprietary API and may be removed in a future release
XMLSerializer serializer = new XML11Serializer(writer, of);
I tried many things but none worked for me. for instance:
//compileJava.options.compilerArgs << ‘-Xlint:-deprecation’
//compileJava.options.compilerArgs << ‘-Xlint:none’
//compileJava.options.compilerArgs << ‘-XDignore.symbol.file’
//compileJava.options.warnings = false
//compileJava.options.compilerArgs += ["-nowarn"]
//tasks.withType (JavaCompile) {
// options.deprecation = false
//}
//tasks.withType (JavaCompile){
// options.warnings = false
//}
//compileJava {
// options.compilerArgs << ‘-XDignore.symbol.file’
//}
I don’t know what I am doing wrong. can you help please.
thanx
-Zak
Rene
(René Groeschke)
January 20, 2016, 10:36pm
2
I moved this into the general help section.
jkao
(James Kao)
March 30, 2016, 4:43am
3
That error message can be supressed with -XDignore.symbol.file, but you cannot use that flag with Gradle’s default way of invoking the compiler, as far as I know.
The underlying issue is described in How to set -XDignore.symbol.file=true on some compiles in multi-project build - #13 by Peter_Niederwieser , but it doesn’t look like anything in Gradle has changed.
The only way that seems to work would be to use a forked javac to build the project, as described at:
I have read the other posts related to compiler options but it doesn’t seem to work. The problem is that we are using a Sun private class and it will not compile using Gradle. It does compile in Eclipse with no special settings.
Output:
:Project1:compileJava
\MyClass.java:37: error: package sun.security.pkcs10 does not exist
import sun.security.pkcs10.PKCS10;
1 error
FAILED
We are planning to migrate off of the Sun private implementation but in the mean time we need the project to compi…
zak
(zak guler)
March 30, 2016, 3:01pm
4
Well, at least I know now that it won’t work for a while. too bad. Thank you James for your reply.
-Zak
jkao
(James Kao)
March 31, 2016, 1:14am
5
Doing the forked javac does work. I just added it to my project that had similar internal API warnings relating to the X509 sun classes:
compileJava { options.compilerArgs << '-XDignore.symbol.file' options.fork = true options.forkOptions.executable = 'javac' }
2 Likes
zak
(zak guler)
March 31, 2016, 3:30pm
6
sweet. will try it and let you know.
thank you James
-Zak
zak
(zak guler)
April 12, 2016, 8:24pm
7
James
yes, it worked. it suppressed the swing warning messages. thank you very much.
-Zak