简体   繁体   English

强制Java Applet在32位而不是64位JRE中运行

[英]Force java applet to run in 32-bit instead of 64-bit JRE

I have a Java applet, designed under 32-bit JDK (1.5). 我有一个Java小程序,是在32位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). 当在新的MacOS(10.7)上部署它时,它运行不正确-因为默认情况下,此系统中首选64位JRE(有32位和64位供选择)。 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. 如果首先将首选顺序更改为32位,则一切正常-但这不是解决方案,因为在客户端计算机上更改设置很不方便。 For a standalone application bundle it could be fixed with proper settings in info.plist, just specifying app architecture. 对于独立的应用程序捆绑包,可以通过在info.plist中进行适当设置(仅指定应用程序体系结构)进行修复。

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? 那么,有什么方法可以在启动applet时做同样的事情-指定i386体系结构,强制浏览器运行32位JRE,强制JVM以32位运行,还是其他?

For now I found only how to specify JRE version/family for the applet, it doesn't help. 到目前为止,我只找到了如何为applet指定JRE版本/系列,这无济于事。 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>

Would appreciate the proposals! 不胜感激建议!

So, the problem is kind of solved, if anyone is interested. 因此,如果有人感兴趣的话,这个问题就可以解决。

For an applet it's impossible. 对于applet,这是不可能的。 It is possible to launch JVM in 32-bit mode with the use of Java Web Start. 可以使用Java Web Start以32位模式启动JVM。 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. 但是,对于当前的(Java SE 6)实现,JWS比applet更加不方便,因为配置文件中的绝对“ codebase”字段限制了applet /应用程序的部署。

It seems that problem is in JRE implementation - my program really has very limited system-specific parts, and no part that depend of bitness. 看来问题出在JRE实现中-我的程序实际上只具有非常有限的系统特定部分,而没有依赖于位的部分。 Would continue testing, to localise a problem for a bug report :) 将会继续测试,以将错误报告本地化:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM