This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Access restriction on rt.jar file in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Access restriction on rt.jar file in Eclipse" Watch "Access restriction on rt.jar file in Eclipse" New topic
Author

Access restriction on rt.jar file in Eclipse

Dipti Mogare
Greenhorn

Joined: Jan 17, 2012
Posts: 9
Hi,
I am using javax.activation.DataHandler class from rt.jar file in my program. But it is giving me error as access restriction. Error is access to jre/lib/rt.jar is restricted. So please suggest me solution for this problem.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Hi, Dipti, and welcome to the Ranch!

Can you plase TellTheDetails about what you're doing and where the error is coming from? How are you running your program? Is it an applet, a standalone app, or something else? Are you running it inside Eclipse? If so, have you tried running on the command line? What are the permission settings on the rt.jar file, and which user owns it? Is this error message part of an exception with stack trace? If so, please copy/paste the whole error message. Or is it coming from outside the execution of your program?

The more details you provide about what you're doing and what results you're seeing, the better the chance somebody will be able to help you.
Dipti Mogare
Greenhorn

Joined: Jan 17, 2012
Posts: 9
Hi,
I am using the import javax.activation.DataHandler.
And from this import using storeDocument() method.
I am getting access restriction error in import javax.activation.DataHandler statement.
And i am running this program as stand alone application in Eclipse IDE. Error is coming at the compile time.
And error message is access to jre/lib/rt.jar is restricted. I have added jre6 in build path.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Dipti Mogare wrote:Hi,
I am using the import javax.activation.DataHandler.
And from this import using storeDocument() method.
I am getting access restriction error in import javax.activation.DataHandler statement.
And i am running this program as stand alone application in Eclipse IDE. Error is coming at the compile time.
And error message is access to jre/lib/rt.jar is restricted. I have added jre6 in build path.


And that's the exact wording that Eclipse is giving you? "access to jre/lib/rt.jar is restricted"? And nothing more?

Did you try googling for, say, access to jre/lib/rt.jar is restricted eclipse?

Did you try compiling on the command line, outside of Eclipse, to see if the problem is in your Eclipse setup or your Java installation?
Dipti Mogare
Greenhorn

Joined: Jan 17, 2012
Posts: 9
Hi jeff.
I found the solution for above problem. I just removed jre from build path and again added the same jre. And an error was removed.
 
jQuery in Action, 2nd edition
 
subject: Access restriction on rt.jar file in Eclipse
 
Similar Threads
troubles importing CachedRowSetImpl
configuring Tomcat 5.0 with eclipse
javax.crypto.BadPaddingException: Given final block not properly padded
Complete Java 2 Cert Study Guide - Distributed Notification
Import in Java