【发布时间】:2015-06-14 15:24:18
【问题描述】:
我使用 OS X Yosemite (10.10.2),我必须使用 JDK 1.5 来开发遗留应用程序。我发现this 帖子是指this 在 Lion 和 Mavericks 中安装 JDK 4、5、6 的脚本。在 cmets 我发现了这两行
/usr/libexec/PlistBuddy -c "Set :JavaVM:JVMMaximumFrameworkVersion 14.*.*" ./Resources/Info.plist
/usr/libexec/PlistBuddy -c "Set :JavaVM:JVMMaximumSystemVersion "$osx_version".*" ./Resources/Info.plist
必须改变
/usr/libexec/PlistBuddy -c "Delete :JavaVM:JVMMaximumFrameworkVersion" ./Resources/Info.plist
/usr/libexec/PlistBuddy -c "Delete :JavaVM:JVMMaximumSystemVersion" ./Resources/Info.plist
实现与优胜美地的兼容性。我运行了这个脚本,这是我的 /System/Library/Frameworks/JavaVM.framework/Versions 目录的内容
lrwxr-xr-x 1 root wheel 10 8 apr 14:36 1.4 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 8 apr 14:36 1.4.2 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 9 apr 11:01 1.5 -> ./1.5.0_30
lrwxr-xr-x 1 root wheel 10 9 apr 11:01 1.5.0 -> ./1.5.0_30
drwxr-xr-x 9 root wheel 306 9 apr 11:01 1.5.0_30
lrwxr-xr-x 1 root wheel 10 8 apr 14:36 1.6 -> CurrentJDK
lrwxr-xr-x 1 root wheel 10 8 apr 14:36 1.6.0 -> CurrentJDK
drwxr-xr-x 7 root wheel 238 8 apr 14:36 A
lrwxr-xr-x 1 root wheel 1 8 apr 14:36 Current -> A
在 Eclipse 首选项 Java->Installed JREs->Execution Environments 中,没有任何 JRE 1.5
这可能是我无法在 Java 5 中构建项目的原因,因为我得到了错误:
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
在 Eclipse 首选项中已安装的 JRE - JSE-1.5 指的是正确的路径
在项目首选项Java Build Path中包含J2SE-1.5
并且项目首选项中的 Java Compiler 设置也正确。
这是/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0_30目录的内容
这个帖子引用了我的previous 帖子。
【问题讨论】:
-
为什么要安装 Java 1.5? PS:不是我的反对票。
-
在这个帖子中你可以看到为什么在一些答案stackoverflow.com/questions/2846573/…
标签: java eclipse macos osx-yosemite jdk1.5