在 Eclipse 中导入 JAI 时出现问题

发布于 2024-09-03 10:02:10 字数 1746 浏览 12 评论 0原文

我尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

只有一腔孤勇 2024-09-10 10:02:10

您可以检查文件的权限。 10.5 看起来像这样:

$ ls -l /System/Library/Java/Extensions/jai_core.jar
-rw-r--r--  1 root  wheel  1893836 May 31  2008 /System/Library/Java/Extensions/jai_core.jar

You might check file's the permissions. Here's what 10.5 looks like:

$ ls -l /System/Library/Java/Extensions/jai_core.jar
-rw-r--r--  1 root  wheel  1893836 May 31  2008 /System/Library/Java/Extensions/jai_core.jar
初见终念 2024-09-10 10:02:10

通过从构建路径中删除 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文