Internal Error: IllegalAccessError (OSX)

When invoking Gradle I get

java.lang.IllegalAccessError: tried to access class org.jruby.ext.posix.BaseNativePOSIX from class org.gradle.internal.nativeplatform.filesystem.FileSystemServices

Gradle 1.7 and 1.6 OSX 10.7.5 Java version 1.7 (and tested with 1.6 – even tried -d32)

Full stack trace: https://gist.github.com/vrvolle/6260945

I even tried to build Gradle myself, but get the same problem when building Gradle itself

Found an old jruby under

/Library/Java/Extension

that was in the way

(found it by using -Djava.security.debug=all)

After removing it, Gradle worked fine.