强制 java 小程序在 32 位而不是 64 位 JRE 中运行 [英] Force java applet to run in 32-bit instead of 64-bit JRE

查看:29
本文介绍了强制 java 小程序在 32 位而不是 64 位 JRE 中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在 32 位 JDK (1.5) 下设计的 Java 小程序.在新的 MacOS (10.7) 上部署它时,它运行不正确 - 因为在该系统中默认首选 64 位 JRE(有两个可供选择,32 位和 64 位).如果首选顺序先更改为 32 位,则一切正常 - 但这不是解决方案,因为更改客户端计算机上的设置很不方便.对于独立的应用程序包,它可以通过 info.plist 中的适当设置进行修复,只需指定应用程序架构即可.

I have a Java applet, designed under 32-bit JDK (1.5). When deploying it on a new MacOS (10.7) it runs incorrectly - because 64-bit JRE is preferred by default in this system (there are two for choose, 32 and 64 bit). If preferred order is changed to 32-bit first, everything is OK - but that's not a solution, because changing settings on a client machine is inconvenient. For a standalone application bundle it could be fixed with proper settings in info.plist, just specifying app architecture.

那么,有没有办法在启动小程序时做同样的事情 - 指定 i386 架构,强制浏览器运行 32 位 JRE,强制 JVM 以 32 位工作,或者其他任何东西?

So, is there a way to make a same thing when launching applet - to specify i386 architecture, force browser to run 32-bit JRE, force JVM to work in 32 bit, or anything?

目前我只找到了如何为小程序指定 JRE 版本/系列,它没有帮助.我正在尝试使用以下代码启动小程序:

For now I found only how to specify JRE version/family for the applet, it doesn't help. I'm trying to launch an applet using the code like:

<object
classid="clsid:CAFEEFAC-0015-0000-FFFF-ABCDEFFEDCBA"
width="740" height="400"
codetype = "application/x-java-applet;version=1.5"
>
<param name="code" value = "ca/lcsi/Program/App/LogoFrameApplet.class"> 
<param name="archive" value="webplayer.jar">
<param name="project" value="testpath.tsfp"> 
<param name="lang" value="en">
    <embed 
    type="application/x-java-applet;version=1.5" 
    code="ca/lcsi/Program/App/LogoFrameApplet.class"
    archive = "webplayer.jar"
    project = "testpath.tsfp"
    lang = "en"
    width="740" height="400"
    >
</object>

非常感谢您的建议!

推荐答案

所以,问题已经解决了,如果有人感兴趣的话.

So, the problem is kind of solved, if anyone is interested.

对于小程序,这是不可能的.可以使用 Java Web Start 以 32 位模式启动 JVM.但是在当前(Java SE 6)实现中,JWS 不如小程序方便,因为配置文件中的绝对代码库"字段限制了小程序/应用程序的部署.

For an applet it's impossible. It is possible to launch JVM in 32-bit mode with the use of Java Web Start. But with current (Java SE 6) implementation, JWS is less convenient than applets, because of an absolute 'codebase' field in config file, which limits the deployment of an applet/application.

问题似乎出在 JRE 实现中 - 我的程序确实具有非常有限的系统特定部分,并且没有任何部分取决于位数.将继续测试,以定位错误报告的问题:)

It seems that problem is in JRE implementation - my program really has very limited system-specific parts, and no part that depend of bitness. Would continue testing, to localise a problem for a bug report :)

这篇关于强制 java 小程序在 32 位而不是 64 位 JRE 中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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