Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

possible to force a 64-bit JVM to use 32-bit mode via the argument "-d32"?

so I have some 3rd party native library that works only in 32 bit JVM across windows,osx,linux and I need to always enforce the java application to run in 32 bit JVM mode.

What about if the target system only has 64-bit JVM installed, would it be possible to force it to run the java application in 32 bit mode?

like image 692
KJW Avatar asked Dec 04 '11 08:12

KJW


People also ask

How do I force 32-bit mode?

if it is a shortcut you can right click and choose "open file location". Then right click the program, then click properties then go to the compatibility tab. Then check the box next to "Run this program in compatibility mode for:". Then choose which OS version to run it in compatibility mode for.


3 Answers

No.

The preconditions that you specified prohibit (okay, I'm precluding the bundle-the-JVM solution and install-the-JVM solution) the application from running in a 32-bit JRE. If you want to run your application in a 32-bit JVM, and your third party native library is only available as a 32-bit DLL, then you must use a 32-bit JVM. A 64-bit JVM cannot load the 32-bit library; there is no 32-bit mode to load such libraries.

Solutions include:

  • Require the 32-bit JVM to be installed
  • Bundle the 32-bit JVM (the three OS's - that'll be a pretty big burden)
  • Install the 32-bit JVM for the user
  • Use a different third party library / roll your own / find a 64-bit version of the third party library
like image 125
user314104 Avatar answered Oct 01 '22 09:10

user314104


With Java 6, no. With Java 7+, yes.

Use -d32 with Java 7

like image 32
Dermot Doherty Avatar answered Oct 01 '22 10:10

Dermot Doherty


possible to force a 64-bit JVM to use 32-bit mode via the argument “-d32”?

As there is no such argument to the java command, the answer is obviously 'no'.

like image 1
user207421 Avatar answered Oct 01 '22 11:10

user207421