Mac OS X 10.7.5上的Java 6 [英] java 6 on mac os x 10.7.5

查看:97
本文介绍了Mac OS X 10.7.5上的Java 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mac上,我在本地删除了Java,只是使用Java(/System/Library/Frameworks/JavaVM.framework/Versions/)删除了该文件夹.

On my Mac, I deleted java locally, just deleted the folder with java (/System/Library/Frameworks/JavaVM.framework/Versions/).

当我再次安装Java 6时,我已安装到:/Library/Java/JavaVirtualMachines/

When I install java 6 again, I was installed into: /Library/Java/JavaVirtualMachines/

然后在安装新的后,尝试从控制台调用"./java"时出现此错误:

Then after installation new one, I have this error when trying to invoke './java' from the console:

在这里,我将Java放入主目录.但是,即使使用标准版本,我也有相同的例外情况:

Here I put java into my home directory. But, even if use standard one I've got the same exception:

dyld: Library not loaded: /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM
  Referenced from: /Users/myuser/java/1.6.0.jdk/Contents/Home/bin/./java
  Reason: image not found
Trace/BPT trap: 5

有什么办法可以解决?

--- 2 ---

---2---

在这里,我只是从另一台机器上复制了正常工作的Java 6,并放置到正确/默认位置,然后转到.../bin并输入./java:

Here I just copied working Java 6 from different machine and put to proper/default location, then go to .../bin and type ./java:

$ pwd
/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin
$ ./java -version
dyld: Library not loaded: @rpath/libjli.jnilib
  Referenced from: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/./java
  Reason: image not found
Trace/BPT trap: 5

但是如果安装Java 7,它会完美运行.

But if install Java 7, it works perfectly.

-3-

如果在其中安装了带有jdk6的JavaDeveloper.pkg软件包(javadeveloper_for_os_x_2012006__11m3909.dmg)-从Apple网站

If install JavaDeveloper.pkg package (javadeveloper_for_os_x_2012006__11m3909.dmg) with jdk6 in it - from Apple site

dyld:未加载库:/System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM 引用自:/Library/Java/JavaVirtualMachines/1.6.0_37-b06-434.jdk/Contents/Home/bin/./java 原因:找不到图片 跟踪/BPT陷阱:5

dyld: Library not loaded: /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM Referenced from: /Library/Java/JavaVirtualMachines/1.6.0_37-b06-434.jdk/Contents/Home/bin/./java Reason: image not found Trace/BPT trap: 5

-4-

如果尝试从 mac端口

$ sudo端口安装openjdk6

info:build Exiting because of the above error(s). \n 
:info:build make: *** [post-sanity] Error 1
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_java_openjdk6/openjdk6/work/." && /usr/bin/make  ARCH_DATA_MODEL="64" ALT_BOOTDIR="/opt/local/share/java/openjdk6_bootstrap" ALT_JDK_IMPORT_PATH="/opt/local/share/java/openjdk6_bootstrap" ALT_BINARY_PLUGS_PATH="/opt/local/share/java/icedtea6-plugs/jre/lib/rt-closed.jar" ALT_DROPS_DIR="/opt/local/var/macports/distfiles/openjdk6" ANT_HOME="/opt/local/share/java/apache-ant" ALT_FREETYPE_HEADERS_PATH="/opt/local/include" ALT_FREETYPE_LIB_PATH="/opt/local/lib" ALT_CUPS_HEADERS_PATH="/usr/include" ALT_MOTIF_DIR="/opt/local" ALT_X11_PATH="/opt/local" ALT_DEVTOOLS_PATH=/usr ALT_CACERTS_FILE=/System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts NO_DOCS=true LANG="C" BUILD_NUMBER="b20" MILESTONE=fcs HOTSPOT_BUILD_JOBS="2"  
**:info:build Exit code: 2
:error:build org.macports.build for port openjdk6 returned: command execution failed
:debug:build Error code: CHILDSTATUS 7773 2
:debug:build Backtrace: command execution failed**

推荐答案

好.我修好了.

问题在于Java位于两个位置.

The problem was that there are two places that Java is located.

  1. /System/Library/Frameworks/JavaVM.framework(位于真正的jdk 6中)
  2. /Library/Java/JavaVirtualMachines/(现在可能是java6,它只有链接)

如果将JDK放在源1中,它将尝试使用特定版本的Java(在我的情况下是1.6.0)(通过符号链接)引用源2,并且找不到合适的对象/文件来链接.

And if put JDK to source 1, it will try refers to source 2 (by symlinks) using specific version of java (in my case it is 1.6.0) and it could not find proper object/file to link to.

修复后,它便开始工作.

As soon as I fixed it started working.

因此,我刚刚恢复了所有内容,并从另一台正在运行的计算机上获取了它.这个想法是Mac OS使用两个位置来存储与Java相关的文件.

So, I just restored all contents, getting it from another working machine. Bu the idea is that Mac OS uses two locations to store java related files.

这篇关于Mac OS X 10.7.5上的Java 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆