如何使OS X在应用启动时自动安装Java 7而不是Java 6 [英] How to Get OS X to Automatically Install Java 7 on App Launch Instead of Java 6

查看:92
本文介绍了如何使OS X在应用启动时自动安装Java 7而不是Java 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,OS X上不再安装Java,但幸运的是,如果用户尝试启动Java应用,则会收到以下消息:

Java is no longer installed by default on OS X, but fortunately if a user tries to launch a Java app, they receive the following message:

我真的很喜欢这个,因为它清楚地说明了Java是必需的,并提供了一种单击安装的方式.对于最终用户而言,这是简单而轻松的事情.

I really like this, as is clearly explains that Java is required and provides a one-click way to install it. It's simple and painless for end users.

但是,这提示您安装Java SE 6而不是Java SE 7,因为Java SE 7已经停产了一段时间.这甚至发生在OS 10.9.1,即撰写本文时的最新版本.我正在考虑使我的应用程序需要Java SE 7,但我想确保用户将下载正确的版本(我知道我可以捆绑JRE,但我不希望添加它,因为它将使该应用程序翻两番尺寸).理想情况下,我希望继续显示上面显示的对话框,但不是下载Java SE 6,而是下载Java SE 7.

However, this prompts to install Java SE 6 rather than Java SE 7, which has been out for some time. This even happens on OS 10.9.1, the latest version as of this writing. I'm considering making my app require Java SE 7, but I want to ensure that users will be downloading the proper version (I'm aware I can bundle the JRE, but I would prefer not to add it since it would quadruple the app size). Ideally, I'd like for the dialog box shown above to continue to be shown, but instead of downloading Java SE 6, it downloads Java SE 7.

我尝试将应用程序的Info.plist文件中的JVMVersion键更改为1.7+,但这没有任何区别,它仍然提示您下载Java SE 6(如果确实需要下载它) ,将导致不兼容).

I tried changing the JVMVersion key in the Info.plist file of my application to 1.7+, but that didn't make any difference and it still prompted to download Java SE 6 (which if it actually did require it, would result in an incompatibility).

那么有没有一种方法可以让OS X提示用户在启动我的应用程序时下载Java 7?明确地说,我希望这是用户方面的事情.我知道我可以安装Java,但我希望它可以使最终用户尽可能轻松地工作.

So is there a way that I can get OS X to prompt the user to download Java 7 when they launch my app? To be clear, I want this to be something on the user side. I know that I can install Java, but I want it so that it is as painless as possible to the end user.

推荐答案

无法在OS X上自动下载Java7.这是设计使然.部署OS X应用程序时,应将应用程序启动所需的所有内容放入应用程序包中,包括JRE或JDK(如果需要).如果发现JRE或JDK的大小不可接受,则可以删除不需要的任何组件(JavaFX,AWT,JObjC等).

There is no way to automatically download Java 7 on OS X. This is by design. When you deploy an OS X application, you are expected to put everything that is required for the app to launching into the app bundle — inclusive of the JRE or JDK if you need it. If you find that the size of the JRE or JDK is unacceptable, you can prune out any components you don't need (JavaFX, AWT, JObjC, etc).

这是您可以提供的最轻松的用户体验.下载,双击并继续.

This is the most painless user experience you can offer. Download, double-click, and go.

这篇关于如何使OS X在应用启动时自动安装Java 7而不是Java 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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