从Java应用程序安装程序中查找Mac OS X上所有可用的JRE

时间:2008-09-15 14:08:21

标签: java macos installer

如果Java应用程序需要某些JRE版本,那么如何在安装期间检查其在Mac OS X上的可用性?

2 个答案:

答案 0 :(得分:1)

应该像查看/System/Library/Frameworks/JavaVM.framework/Versions /

一样简单

E.g。从我的机器:

manoa:~ stu$ ll /System/Library/Frameworks/JavaVM.framework/Versions/
total 56
774077 lrwxr-xr-x  1 root  wheel    5 Jul 23 15:31 1.3 -> 1.3.1
167151 drwxr-xr-x  3 root  wheel  102 Jan 14  2008 1.3.1
167793 lrwxr-xr-x  1 root  wheel    5 Feb 21  2008 1.4 -> 1.4.2
774079 lrwxr-xr-x  1 root  wheel    3 Jul 23 15:31 1.4.1 -> 1.4
166913 drwxr-xr-x  8 root  wheel  272 Feb 21  2008 1.4.2
168494 lrwxr-xr-x  1 root  wheel    5 Feb 21  2008 1.5 -> 1.5.0
166930 drwxr-xr-x  8 root  wheel  272 Feb 21  2008 1.5.0
774585 lrwxr-xr-x  1 root  wheel    5 Jul 23 15:31 1.6 -> 1.6.0
747415 drwxr-xr-x  8 root  wheel  272 Jul 23 10:24 1.6.0
167155 drwxr-xr-x  8 root  wheel  272 Jul 23 15:31 A
776765 lrwxr-xr-x  1 root  wheel    1 Jul 23 15:31 Current -> A
774125 lrwxr-xr-x  1 root  wheel    3 Jul 23 15:31 CurrentJDK -> 1.5
manoa:~ stu$ 

答案 1 :(得分:0)

这篇文章可能有所帮助: http://developer.apple.com/technotes/tn2002/tn2110.html
总结