损坏的 Java Mac 10.6

发布于 2024-08-06 02:45:44 字数 602 浏览 5 评论 0原文

一些背景:

在使用 Macports 的 Mac OS X 10.6 上,我在 .bash_profile 中设置了 DYLD_LIBRARY_PATH 。

问题:

当我运行 java -version 时,出现以下错误:

VM 初始化期间发生错误
无法加载本机库:libjava.jnilib

通过一个有用的论坛线程,我发现问题是“/opt/local/lib”目录中的某些文件由于我设置的 DYLD_LIBRARY_PATH 而导致出现问题。

当我从“/opt/local/lib”中删除以 libgif、libjpeg、libpng 和 libtiff 开头的文件时,问题消失并且“java -version”工作,但依赖于这些文件的端口中断。

有人知道我可以保留文件并仍然让 java 正常工作的方法吗?可能设置java路径,我不太确定该怎么做,并且我所有的尝试都失败了。

谢谢。

Some background:

On Mac OS X 10.6 using Macports and I have DYLD_LIBRARY_PATH set in my .bash_profile.

The problem:

When I run java -version I get this error:

Error occurred during initialization of VM
Unable to load native library: libjava.jnilib

By way of one helpful forum thread, I've discovered the problem is some files in my '/opt/local/lib' directory are causing trouble because of the DYLD_LIBRARY_PATH I've set.

When I remove the files starting with libgif, libjpeg, libpng and libtiff from '/opt/local/lib', the problem goes away and `java -version' works, but the ports that depend on those files break.

Anyone know of a way I can keep the files and still get java to work properly? Possibly setting the java path, which I'm not quite sure how to do and all my attempts have failed.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

追风人 2024-08-13 02:45:44

不要设置DYLD_LIBRARY_PATH。由于此环境变量,动态链接器 dyld 正在查找 /opt/local/lib/libjpeg.dylib 等,而不是不同的 /System/Library/Frameworks//ApplicationServices.framework它需要的 /Versions/A/Frameworks/ImageIO.framework/Resources/libJPEG.dylib

Don't set DYLD_LIBRARY_PATH. Because of this env var, the dynamic linker dyld, is finding /opt/local/lib/libjpeg.dylib etc. instead of the different /System/Library/Frameworks//ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Resources/libJPEG.dylib that it needs.

っ〆星空下的拥抱 2024-08-13 02:45:44

这似乎适用于 OS X Lion:

取消设置 DYLD_LIBRARY_PATH

This seems to work on OS X Lion:

unset DYLD_LIBRARY_PATH

岁月染过的梦 2024-08-13 02:45:44

似乎导致此问题的一个可能原因是文件保护问题?请参阅我的帖子 其他线程

Seems one possible cause of this a file protection problem? See my post over in this other thread.

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