java will intermittently not resolve symlinks on Linux java will intermittently not resolve symlinks on Linux linux linux

java will intermittently not resolve symlinks on Linux


A colleague of mine confirmed the issue on OpenJDK 6u23, but not on any prior or following versions. That being said, since the issue has

A) a work around in the form of the system property

-Dsun.io.useCanonCaches=false OR-Dsun.io.useCanonPrefixCache=false

B) appears to be resolved in the later build (u24)

there appears to be little motivation to dig any deeper.


In Unix a symlink is a "special" file, with its own permissions.

The fact that you have read permission on the symbolic link doesn't imply you'll have it for the file linked.

My guess here is that you are running your program as an user that can read the symlink but not the actual file.

When entering debug mode you trigger the call to some method that change the internal state of the FilePermission object making it resolve to the actual file and thus returning you "false".

When you get "true" it's just telling you that you can read the symbolic link.

In your place, I'll check permission on this file: - /usr/share/java/gnome-java-bridge.jar

and to the two directories: - /usr/share - /usr/share/java