I have a JNLP applet that is run on a 64bit computer with both 32 and 64 bits JVM installed. The JNLP must run on the 64bit JVM in order to execute correctly. Is there a way to force the use of a 64bit JVM?
Use -d64
the VM option to only allow the virtual machine to start at 64bits. Other way it's simple not start. Not to friendly but make the job. In console mode print:
Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.
-d64
is supported since 1.5.0
See here: How can I tell if I'm running in 64-bit JVM or 32-bit JVM (from within a program)?
You can use this to detect a 64-bit JVM, and if it's not, you show an error message.
If you use a 64Bit Browser then the 64Bit JVM is used. If you use a 32Bit Browser (which is default for most browsers nowadays) the 32Bit JVM is used. So e.g. firefox and chrome only have 32Bit versions out there (of course there are test/develop versions out there but nothing official). Microsofts IE is one of the few offering both versions.
You can not ensure that the jnlp will run in 64 Bit environment. However you can ensure in your applet code, that is was started in the right environment:
String architecture = System.getProperty("os.arch");
if(architecture.equals("i386") || architecture.equals("i686")){
architecture = "x86";
}
else if(architecture.equals("amd64") || architecture.equals("universal")){
architecture = "x86_64";
}
© 2022 - 2024 — McMap. All rights reserved.