[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [tycho-user] 1.0 fails build with access restriction
|
I assume you are accessing JDK internal packages.
If you want to relax access restriction errors, you should be able to use
https://eclipse.org/tycho/sitedocs/tycho-compiler-plugin/compile-mojo.html#compilerArgs
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<compilerArgs>
<arg>-err:-forbidden</arg>
</compilerArgs>
</configuration>
</plugin>
note the nested compilerArgs XML structure. If you put two compilerArgument flattened into the configuration, I'm not sure which one wins or if it's even specified.
See JDT batch compiler args
https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm
Jan
On 21.04.17, 15:55, "tycho-user-bounces@xxxxxxxxxxx on behalf of Hussein, Mohamed" <tycho-user-bounces@xxxxxxxxxxx on behalf of mohamed_hussein@xxxxxxxxxx> wrote:
Hi,
I had a build of a plugin that uses DOM classes from rt.jar that was building fine with 0.26.0 but when I changed Tycho.version to 1.0.0 it started failing with the following error:
[ERROR] serializer.getDomConfig().setParameter(Constants.DOM_FORMAT_PRETTY_PRINT, true);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Access restriction: The field 'Constants.DOM_FORMAT_PRETTY_PRINT' is not API (restriction on classpath entry 'C:\bin\jdk1.8.0_112\jre\lib\rt.jar')
I have the following in the configuration of the Tycho-compiler-plugin
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<compilerArgument>-warn:none</compilerArgument>
<compilerArgument>-err:none</compilerArgument>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
I also tried
<compilerArgument>-err:-forbidden</compilerArgument>
<compilerArgument>-warn:-forbidden</compilerArgument>
I read through
https://bugs.eclipse.org/bugs/show_bug.cgi?id=369187 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=369187> and
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367431 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=367431> but couldn’t understand what more to do.
State:
-
Building with 0.26.0 with no compiler arguments FAIL
-
Building with 0.26.0 with –warn:none and –err:none compiler arguments *PASS*
-
Building with 1.0.0 with –warn:none and –err:none compiler arguments FAIL
-
Building with 1.0.0 with no compiler arguments FAIL
Any clues?
Best Regards,
Mohamed.