Java Webstart 使用错误版本的 JRE 运行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9802577/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Webstart runs with wrong version of JRE
提问by assylias
I have a Java webstart application that requires Java 7+, so the JNLP has this line:
我有一个需要 Java 7+ 的 Java webstart 应用程序,所以 JNLP 有这一行:
<j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se"/>
This works on various Windows XP & Windows 7 machines (most of them also having Java 6 installed) but on one of them, webstart is launched with Java 6 and fails (wrong version of JRE). I found this postand checked the Java settings and they look fine:
这适用于各种 Windows XP 和 Windows 7 机器(其中大多数还安装了 Java 6),但在其中一台机器上,webstart 使用 Java 6 启动并失败(错误版本的 JRE)。我找到了这篇文章并检查了 Java 设置,它们看起来不错:
I have also tried changing the JNLP line to this but it still does not work:
我也尝试将 JNLP 行更改为此,但它仍然不起作用:
<j2se version="1.7+"/>
Any ideas on how to let webstart know that the JRE 1.7 is there?
关于如何让 webstart 知道 JRE 1.7 存在的任何想法?
Config: Windows 7, run as administrator - webstart application launched from IE.
配置:Windows 7,以管理员身份运行 - 从 IE 启动的 webstart 应用程序。
采纳答案by assylias
I found the problem. I had Java 6 32bits & 64bits installed, but Java 7 only had the 64bits version installed. And I was launching the webstart link from Internet Explorer 32 bits, which I suppose cannot use a 64 bits version of JRE.
我发现了问题。我安装了 Java 6 32 位和 64 位,但 Java 7 只安装了 64 位版本。我从 Internet Explorer 32 位启动 webstart 链接,我想它不能使用 64 位版本的 JRE。
Launching the webstart from IE 64 bits worked fine.
从 IE 64 位启动 webstart 工作正常。
Thanks for your comments, I figured the problem out while doing one of the manipulations you recommended.
感谢您的评论,我在执行您推荐的操作之一时发现了问题。
回答by Matthew Wise
I had a similar problem with Java 6 being used to launch JNLPs rather than Java 7 (I have both installed), even though my JAVA_HOME, PATH and Java Control Panel settings were all set to 7. Java 7 would be used when launching from a web page, but from a desktop shortcut, Java 6 was being used and so be unable to launch the app since it requires 7.
即使我的 JAVA_HOME、PATH 和 Java 控制面板设置都设置为 7,我在使用 Java 6 而不是 Java 7 来启动 JNLP 而不是 Java 7 时也遇到了类似的问题。网页,但从桌面快捷方式,Java 6 正在使用,因此无法启动该应用程序,因为它需要 7。
Turns out that there are java, javaw and javaws executables present in C:\Windows\SysWOW64 and this is what the generated shortcut points to. So I overwrote those EXEs with the ones from C:\Program Files\Java\jre7\bin.
结果发现 C:\Windows\SysWOW64 中存在 java、javaw 和 javaws 可执行文件,这就是生成的快捷方式指向的内容。所以我用来自 C:\Program Files\Java\jre7\bin 的那些 EXE 覆盖了这些 EXE。
Perhaps a reinstallation of JRE 7 would also have fixed this but I just went for this quick fix.
也许重新安装 JRE 7 也可以解决这个问题,但我只是进行了这个快速修复。