The type X is not accessible due to restriction on the...
Read the article on my new blog under http://blog.js-development.com/2008/11/type-x-is-not-accessible-due-to.html
For some university course we currently have to modify an Open Source application with LOC > 50,000. So due to our particular interest in Eclipse RCP development, our team has chosen the RSSOwl, a smart Newsfeed reader which is based on Eclipse RCP (you should check it out).
After downloading the latest source from the code repository, the build seemed to be broken since it reported about 18 errors saying something like:
The type [X] is not accessible due to restriction on required library [Y]....where [X] and [Y] are of course placeholders for the class and jar library :) . After some (actually long) search on the web, one of my collegues found the "solution" for the problem. It was actually a wrong Eclipse configuration of the Java compiler. What has to be done is to set the "Forbidden reference (access rules)" under the "Deprecated and restricted API" from "Error" to "Warning".
In this way Eclipse will treat the problem as a warning instead of an error. I discussed that configuration with the RSSOwl author and he affirmed me that it is fine to have the configuration set to "warning".



21 Comments:
Thanks so much. After so many hours, I found the solution.
thanks again
Thanks, that was indeed very useful :)
thanks!
thanks a lot.
this realy helped
Thanks, Juri. That saved me a lot of time.
thanks alot! :)
Thanks a lot this helped me.....
thanks for the info. really a big time saver...
Спасибо большое, очень помогло!
Thanks a lot!
Thanks, I was hours searching for this!!!!!
Alright, but why does it happen?
Thanks a lot for this solution!
It helped me :-) Thanks
thanks so much ... I would have never thought it was an eclipse problem and would have tried everything else first ... so thanks for saving me a lot of wasted time!
if you "add external jars" at project setup there will be no errors or warnings and will run fine.
just press "add external jars" and navigate to programfiles(*86), java, jre6, lib, ext, select all contents and click open and finish the project. Cant be to hard because I figured it out all by myself and I am only 14 and on my first year of java.
Thank you for the solution...
Thanks for the solution! you rock! :)
Thanks a lot.
Thanks a lot! It worked for me :)
Thanks for that. Quickly soleved an annoying problem.
@14yo Anonymous: If I understand your way correct, you are importing java files into your project. Of course the restrictions will disappear then (since the jars are in your project).
But you will deliver some java files with your solution, which might have weired effects if someone starts your application using another java version.
So there is no need to be overconfident.
Post a Comment