2

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.

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?

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>

Would appreciate the proposals!

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Justin Trevein
  • 1,496
  • 3
  • 12
  • 16
  • 2 questions: Why does it run incorrectly and why do you think it has to do with the JRE? – Mister Smith Oct 10 '11 at 14:19
  • 1
    1) Why? I don't know. As far as I know, program doesn't use any native libraries. 2) As I said, if I choose another (32-bit) JRE on a client machine as preferred, it works well. – Justin Trevein Oct 10 '11 at 14:28
  • Could you post some details on the error so that we can help you? – Mister Smith Oct 10 '11 at 14:39
  • It runs normally, just with some bug. Sorry, don't think I would go that way - I don't need a working 64-bit applet, at least for just now, so cheaper is to run it as the 32-bit, than try to solve a bug (only one discovered, there could be more). What I need is a key or a property to pass to a launching applet to make it start in 32-bit JRE. – Justin Trevein Oct 10 '11 at 14:47
  • Please define "some bug". If you are not using JNI the classes should be portable and work as expected. There's no x64 bytecode or x32 bytecode. WORE etc. – Mister Smith Oct 10 '11 at 14:53
  • I know it should be portable. Still, though it doesn't use the JNI, I can't be sure it doesn't contain any native implemenations, because project was not started by me. That's whay I don't want to dig in code and debug it, but want to get a workaround. – Justin Trevein Oct 10 '11 at 15:00
  • 1
    If you insist, the bug is: when launching internal process twice (from two controls), it stops responding instead of stopping previous instance and launching new. – Justin Trevein Oct 10 '11 at 15:08

1 Answers1

1

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

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.

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 :)

Justin Trevein
  • 1,496
  • 3
  • 12
  • 16
  • For an overall JWS information you could see official docs: http://docs.oracle.com/javase/tutorial/deployment/webstart/deploying.html How to start JVM in 32-bit: write `java-vm-args="-d32"` inside of tag in jnlp file: like `` – Justin Trevein Dec 05 '11 at 11:28