Birodh's Blog

Just another Board of feeling and thoughts….

Error: “Access restriction: The type xxxxxx is not accessible due to restriction on required library /usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar”

Posted by Birodh on February 12, 2011

While running a java project you may find the error:
Error: “Access restriction: The type xxxxx is not accessible due to restriction on required library /usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar”
I found the same error while implementing jain-sip library in my eclipse.
My environment was ubuntu lucid 10.4.
and my runtime was java-6-open-jdk.
Now i found the reason and solution for this.
The reason is rt.jar in java-6-open-jdk is not compatible with your code.
The possible solution can be changing the runtime to java-6-sun.x
How to change the runtime form open-jdk to sun jdk
1. Right click the project
2. Go to Properties
3. Go to java build path
4. Click on the libraries
5. Select the JRE system library
6. Click Edit
7. Select Alternate JRE
8. choose the java-6 sun-1.6.0 or whatever version.
9. Click Finish

I hope you will get ride of that error.
Cheers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s