Java compiler ignore.symbol.file

We are having problems in one of our build scripts allowing jaxb internal classes to be referenced in our source code.

To get this to build, we must be able to set the ignore.symbol.file compiler variable to true.

I have seen this discussed [elsewhere on the forum][1] associated with earlier versions of gradle (1.2 for example).
[1]: How to set -XDignore.symbol.file=true on some compiles in multi-project build

None of the arounds that I have seen (forking the compiler run, running the build script as “ant”, etc…) seem to work for us.

Can anyone confirm:

  1. Whether this problem has been addressed in late versions for gradle 1 or gradle 2?
  2. Whether there is a way to make this work?

Found the answer myself.

The following works in gradle 1.12:

compileJava {
	options.fork = true
	options.forkOptions.executable = 'javac'
	options.compilerArgs << "-XDignore.symbol.file"
}
1 Like

This solution is not working in 2.3.9

I’m pretty new to gradle 2.
Any obvious reasons why this works differently?

Probably doesn’t work in Gradle 2.3.9 because there is no such version :slight_smile:

On a more serious note, please try this:

compileJava {
  options.compilerArgs << "-XDignore.symbol.file=true"
}

Thanks for the reply.

The reason why it wasn’t working in 2.3 was due to a typo in the java file being compiled.

User error. Sorry.