tags:

views:

2694

answers:

2

I get this error message in Eclipse:

Access restriction: The type DirectoryWalker is not accessible
due to restriction on required library 
/Library/Java/Extensions/commons-io-1.4.jar

what does this mean? There's this other SO question on the same topic but it doesn't seem to apply in this case. I'm not creating a new java class, I'm trying to use one.

+1  A: 

At a guess another library you are using also requires Apache Commons I/O, but a different version. Having a piece of code (transitively) have access to two versions of the same packages is a little tricky. You can probably arrange it so your code and the other library use the same version. It's all much easier with CLASSPATH! :)

Tom Hawtin - tackline
is there a better well-known place to put .jar files that won't be automatically "sucked in"?
Jason S
Jason S
A: 

For what it's worth, I had this error recently too (different library).

My IDE (MyEclipse) references a certain library as part of the overall project classpath, but I also had a copy of the relevant JAR in my machine's Java extensions folder.

The resulting clash gave the (unhelpful) error that you've experienced. So for anyone else hitting this error, you might want to consider your classpaths too.

Ben Poole