tags:

views:

22

answers:

2

I'm trying to build a test suite program (using JRE 1.6 under Eclipse IDE, Operating System: CentOS 5.4 64 bit) which uses an external jar file (installed under /lib/ext) for some operations. However, my test code is unable to use or link to the jar file and the following error is shown in Eclipse

the method xxx of class yyy is inaccessible due to restrictions place on the library /lib/ext/productxx.jar

I've made sure that I login as root and also done chmod 777 * on /lib/ext directory. Still the error persists.

'Would appreciate any suggestions/comments.

Thanks.

A: 

It looks like access privilege to the classes inside the jar file.

Dheeraj Joshi
+1  A: 

There's a similar SO question with a variety of possible causes and fixes.

Personally, I'd advise strongly against putting anything in /lib/ext - it just causes problems. Instead, add the library into the project's build path.

Another hint: never retype error messages, always cut&paste - any error you make, such as replacing "not accessible" with "inaccessible" here, makes them impossible to search for, which is the single most useful thing about error messages.

Michael Borgwardt
'tried one of the suggestions mentioned in the link. Removing JRE and linking JRE (workspace default) again. It worked. Thanks!
Ankur