How to run 32-bit Java on Mac OSX 10.7 Lion

女生的网名这么多〃 提交于 2019-11-27 11:36:15

I found out now, that the 32-bit JVM can be explicitly launched using the -d32 switch.

On my machine, "java -version -d32" says:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511c)
Java HotSpot(TM) Client VM (build 20.1-b02-383, mixed mode)

and although it doesn't say so, it is a 32-bit JVM.

The latest versions of Java 64-bit have -XX:+UseCompressedOops on by default (if your heap is less than 32 GB). This means 32-bit references are used in any case. The objects are still slightly bigger (4 bytes more overhead)

This article compares 32-bit, 64-bit with UseCompressedOops Java: How much memory do different arrays and collections consume

In terms of performance, I have found it to be 5-10% depending on what you are doing. If you are using a lot of long values it will be faster to use 64-bit.

Go into the "Java Preferences" App and drag java 32 bit to the top of the list.

Try the below steps:

  1. Open terminal and go to /System/Library/Frameworks/JavaVM.framework/Versions/
  2. Type ls -l to list all available Java versions
  3. Enter sudo ln -fhsv CurrentJDK

Reference: Changing Java Version

in /System/Library/Frameworks/JavaVM.framework/Versions I found version 1.6 installed and changed the path for java,javac to point to /System/Library/Frameworks/JavaVM.framework/Versions/1.6/home using environment alias rather than the default link found in /usr/bin/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!