Most of our projects are built with Maven, and some of them use classes in the com.sun package. This is bad practice, but I can't help it.
For a while, this was not a big problem. Then, at some point, the builds started crashing for me with errors like:
java.lang.Error: Unresolved compilation problems:
Access restriction: The type TextSerializer is not accessible due to res
triction on required library C:\Program Files\Java\jre1.5.0_15\lib\rt.jar
This is true, but I could not understand for life how to disable this check. Lines were not executed either from the command line or from Eclipse, so I assumed that this should be a Maven setting.
In the end, I realized that the problem was somehow with Eclipse . I went to Preferences> Java> Compiler> Errors / Warnings> Deprecated and restricted API and changed the "Forbidden Directory" to "Warning". After that, my builds began to work. This is completely incomprehensible to me, because I got errors when building from the command line .
Can someone explain to me how the Eclipse parameter can somehow influence the behavior of the assembly from the command line ?!
source
share