Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Mac OSX 10.7 上,JavaVM 在首次使用时会自动下载(当某些应用程序加载 /System/Library/Frameworks/JavaVM.framework/JavaVM 时)。但如果 JavaVM 不存在,应用程序会立即以退出代码 97 结束。
我的问题是,有没有办法以编程方式(最好是 carbon 方法)确定 JavaVM 是否已经下载并安装,所以我的应用程序可以相应地运行?
我的应用程序是用 C++ 编写的,它基本上是 Java 应用程序的本机启动器。
I found one way. If java is not installed /usr/libexec/java_home doesn't return java home dir and doesn't start download. Downloading could be started by parameter --request.
Anyway would prefer some API.