0

I have a ant process to compile a java 1.8 application. Ant is lauched from Eclipse IDE in Windows running with java 1.17. If I try to run Ant process using a separate JDK (1.8), different from the workspace one, I got this error: enter image description here

I tried to run Ant with the same version of Eclipse (1.17), I had to add these attributes to <javac> element:

target="8" source="8" release="8"

The compilation starts, but it fails with this error:

 java.lang.IllegalAccessError: class org.adrianwalker.multilinestring.JavacMultilineProcessor (in unnamed module @0x4778ea49) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x4778ea49

The failing class (JavacMultilineProcessor) is a annotation processor class. (http://www.adrianwalker.org/2011/12/java-multiline-string.html)

Do you have any idea what happened?

Tobia
  • 9,165
  • 28
  • 114
  • 219

1 Answers1

0

I solved with some other attributes to javac element:

<javac fork="true" executable="C:\Program Files\Java\jdk1.8.0_202\bin\javac" includeantruntime="false" ... />
Tobia
  • 9,165
  • 28
  • 114
  • 219