损坏的 Java Mac 10.6
一些背景:
在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不要设置
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.这似乎适用于 OS X Lion:
取消设置 DYLD_LIBRARY_PATH
This seems to work on OS X Lion:
unset DYLD_LIBRARY_PATH
似乎导致此问题的一个可能原因是文件保护问题?请参阅我的帖子 其他线程。
Seems one possible cause of this a file protection problem? See my post over in this other thread.