在 Eclipse 中导入 JAI 时出现问题
我尝试在 Mac OS X 10.6 上运行的 Eclipse 中使用以下导入:
import javax.media.jai.JAI;
不幸的是,这不起作用,而是收到以下消息:
“访问限制:由于所需库的限制,无法访问类型 JAI / System/Library/Java/Extensions/jai_core.jar”
如何解决这个问题?我想使用 JAI.create("fileload", "filename");
文件夹中的文件权限扩展:
$ ls -l
total 20536
-rwxrwxr-x 1 root wheel 6470 6 Jan 19:20 AppleScriptEngine.jar
-rwxrwxr-x 1 root wheel 12838 23 Apr 18:16 MRJToolkit.jar
-rwxrwxr-x 1 root wheel 938700 3 Mar 01:41 QTJava.zip
-rwxrwxr-x 1 root wheel 17786 11 Feb 13:49 dns_sd.jar
-rwxrwxr-x 1 root wheel 1223487 21 Jul 2009 j3daudio.jar
-rwxrwxr-x 1 root wheel 1157342 21 Jul 2009 j3dcore.jar
-rwxrwxr-x 1 root wheel 685292 21 Jul 2009 j3dutils.jar
-rwxrwxr-x 1 root wheel 275486 18 May 2009 jai_codec.jar
-rwxrwxr-x 1 root wheel 1544537 18 May 2009 jai_core.jar
-rwxrwxr-x 1 root wheel 106688 6 Jan 19:20 libAppleScriptEngine.jnilib
-rwxrwxr-x 1 root wheel 427632 21 Jul 2009 libJ3D.jnilib
-rwxrwxr-x 1 root wheel 733280 21 Jul 2009 libJ3DAudio.jnilib
-rwxrwxr-x 1 root wheel 50880 21 Jul 2009 libJ3DUtils.jnilib
-rwxrwxr-x 1 root wheel 1004544 3 Mar 01:44 libQTJNative.jnilib
-rwxrwxr-x 1 root wheel 50352 23 Dec 10:25 libShark.jnilib
-rwxrwxr-x 1 root wheel 9959424 18 May 2009 libmlib_jai.jnilib
-rwxrwxr-x 1 root wheel 41239 18 May 2009 mlibwrapper_jai.jar
-rwxrwxr-x 1 root wheel 127628 21 Jul 2009 vecmath.jar
可以在此处找到快速修复:http://lkamal.blogspot.com/2008/09/eclipse-access-restriction-on- library.html (但是,这更多的是一种解决方法......)
I'm trying to use the following import in Eclipse running on Mac OS X 10.6:
import javax.media.jai.JAI;
Unfortunately, this doesn't work, instead I get the following message:
"Access restriction: The type JAI is not accessible due to restriction on required library /System/Library/Java/Extensions/jai_core.jar"
How can this be resolved? I want to use JAI.create("fileload", "filename");
The file permissions in the folder Extensions:
$ ls -l
total 20536
-rwxrwxr-x 1 root wheel 6470 6 Jan 19:20 AppleScriptEngine.jar
-rwxrwxr-x 1 root wheel 12838 23 Apr 18:16 MRJToolkit.jar
-rwxrwxr-x 1 root wheel 938700 3 Mar 01:41 QTJava.zip
-rwxrwxr-x 1 root wheel 17786 11 Feb 13:49 dns_sd.jar
-rwxrwxr-x 1 root wheel 1223487 21 Jul 2009 j3daudio.jar
-rwxrwxr-x 1 root wheel 1157342 21 Jul 2009 j3dcore.jar
-rwxrwxr-x 1 root wheel 685292 21 Jul 2009 j3dutils.jar
-rwxrwxr-x 1 root wheel 275486 18 May 2009 jai_codec.jar
-rwxrwxr-x 1 root wheel 1544537 18 May 2009 jai_core.jar
-rwxrwxr-x 1 root wheel 106688 6 Jan 19:20 libAppleScriptEngine.jnilib
-rwxrwxr-x 1 root wheel 427632 21 Jul 2009 libJ3D.jnilib
-rwxrwxr-x 1 root wheel 733280 21 Jul 2009 libJ3DAudio.jnilib
-rwxrwxr-x 1 root wheel 50880 21 Jul 2009 libJ3DUtils.jnilib
-rwxrwxr-x 1 root wheel 1004544 3 Mar 01:44 libQTJNative.jnilib
-rwxrwxr-x 1 root wheel 50352 23 Dec 10:25 libShark.jnilib
-rwxrwxr-x 1 root wheel 9959424 18 May 2009 libmlib_jai.jnilib
-rwxrwxr-x 1 root wheel 41239 18 May 2009 mlibwrapper_jai.jar
-rwxrwxr-x 1 root wheel 127628 21 Jul 2009 vecmath.jar
A quick fix can be found here: http://lkamal.blogspot.com/2008/09/eclipse-access-restriction-on-library.html (However, it's more of a work-around...)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以检查文件的权限。 10.5 看起来像这样:
You might check file's the permissions. Here's what 10.5 looks like:
通过从构建路径中删除 JRE 系统库,然后重新添加它,修复了 JAI 的问题。此修复基于提供的解决方案 在这里。
Fixed my issue with JAI by removing the JRE System Library from the build path and then re-adding it. This fix is based on the solution provided here.