I\'m attempting to compile Java 1.4 code that was created by IBM\'s WSDL2Java on Java5 without recreating
I have been getting this error too, but my project is built on the command line using Maven and the tycho compiler (it's a set of OSGi plugins). After masses of sifting through people having the same problem but fixing it in Eclipse rather than on the command line, I found a message on the Tycho developer forum that answered my question, using configuration in pom.xml
to ignore the compiler warning about the access restriction:
org.eclipse.tycho
tycho-compiler-plugin
${tycho.version}
-warn:+discouraged,forbidden
More information can be found in the Tycho FAQ. This took me AGES to work out, so I figured I would assist anyone else trying to fix these access restriction errors from the command line by posting this answer.