Java小程序:Chrome提示下载java 7,IE和Firefox不下载
我在 Chrome 中运行 Java 小程序时遇到以下问题。
这是我页面中的脚本:
<script type="text/javascript" src="http://www.java.com/js/deployJava.js"></script>
<script type="text/javascript">
var attributes = { code: 'com.mycompany.MyApplet',
id: 'myApplet', name: 'myApplet', width: 710, height: 540 };
var parameters = { jnlp_href: "MyApplet.jnlp" } ;
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>
<noscript>This page requires JavaScript.</noscript>
这是我的 .jnlp:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp href="MyApplet.jnlp">
<information>
<title>My Applet</title>
<vendor>My Company</vendor>
<offline-allowed />
</information>
<resources>
<j2se version="1.6+" />
<jar href="MyApplet.jar" />
</resources>
<applet-desc
name="My Applet"
main-class="com.mycompany.MyApplet"
width="710"
height="540">
</applet-desc>
</jnlp>
我的计算机中安装了 JRE 1.4 和 1.6 update 29。在 IE 和 Firefox 中,小程序可以正确运行,但在 Chrome 中,系统会提示我下载 JRE 7。
如果安装 JRE 7,小程序可以正确运行。但我不能强迫最终用户这样做,因为这个 Web 应用程序将由没有计算机管理权限的人使用。
我读到在这里这是因为 Chrome 中的 deployJava.js 存在错误,并且所述解决方案是删除 alder JRE。不幸的是,这也是不可能的,因为最终用户需要 JRE 4 来运行他们日常使用的其他旧 Java 桌面应用程序。
我可以调整以某种方式发布的 javascript 或 jnlp 以便使用 JRE 1.6 在 Chrome 中工作吗?
I'm having the following problem running a Java applet in Chrome.
This is the script I have in my page:
<script type="text/javascript" src="http://www.java.com/js/deployJava.js"></script>
<script type="text/javascript">
var attributes = { code: 'com.mycompany.MyApplet',
id: 'myApplet', name: 'myApplet', width: 710, height: 540 };
var parameters = { jnlp_href: "MyApplet.jnlp" } ;
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>
<noscript>This page requires JavaScript.</noscript>
And this is my .jnlp:
<?xml version="1.0" encoding="UTF-8"?>
<jnlp href="MyApplet.jnlp">
<information>
<title>My Applet</title>
<vendor>My Company</vendor>
<offline-allowed />
</information>
<resources>
<j2se version="1.6+" />
<jar href="MyApplet.jar" />
</resources>
<applet-desc
name="My Applet"
main-class="com.mycompany.MyApplet"
width="710"
height="540">
</applet-desc>
</jnlp>
I have JREs 1.4 and 1.6 update 29 installed in my machine. In IE and Firefox the applet runs correctly, but in Chrome I'm being prompt to download JRE 7.
If install JRE 7 the applet runs correctly. But I cannot force end users to do that because this web application will be used by people with no administrative rights on their computers.
I read over here that this is because a bug in deployJava.js with Chrome, and the solution stated is to remove alder JREs. Unfortunately, that's not possible either because end users need JRE 4 to run other old Java desktop applications they use everyday.
Can I tweak the javascript or jnlp posted somehow to make this work in Chrome using JRE 1.6?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论