Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
289 views
in Technique[技术] by (71.8m points)

java - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...