A j e e
A j e e

Reputation: 11

How to enable 32 bit Java in safari on Mac OS X 10.8 [Mountain Lion]

I have enabled the Apple provided Java 6 on Mac OS X 10.8. Its working fine but the only issue is that the applet i need to run works only on 32 bit Java plugin. I can't java preferences to select between 32 to 64 or vice versa. I also tried running safari and firefox in 32 mode, but no help.

I have figured out to make it work in terminal by using -d32 switch. However, how to use this switch in safari, am not sure.

EDIT: Please note that I have apple provided Java 6 already. I just need to enabled 32-bit plugin in safari or firefox.

Upvotes: 1

Views: 13441

Answers (3)

Simone
Simone

Reputation: 247

You can pass the parameter -d32 directly into applet param tag.

<applet> <params name="java_arguments" value="-d32" /> ... </applet>

Note that it must be the first applet parameters. Works only with java 1.6 because 1.7 and 1.8 doesn't have a 32 bit version on mac os. Tested with safari, chrome and firefox using OS X 10.8.3

Upvotes: 0

nothize
nothize

Reputation: 108

I am facing the same problem as you.

No matter how hard I tried, the Java 1.6 still runs in 64-bit mode.

My last resort is thinking how to disable the 64-bit capability of the binary so that only the 32-bit mode can be picked....

Answer here:

The key is to replace /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java with a 32-bit mode only binary.

  1. Use "xxd -g1 java | grep -E 'c. fa'" to find out the binary header.
xxd -g1 java | grep -E 'c. fa'
0001000: ce fa ed fe 07 00 00 00 03 00 00 00 02 00 00 00
000c4b0: 01 28 6f d8 ce 3b 3a b0 c9 cd fa 87 b1 35 df 08
000d000: cf fa ed fe 07 00 00 01 03 00 00 80 02 00 00 00
000f060: 00 0f 84 c7 fa ff ff 48 8d 3d 96 39 00 00 be 01

07 00 00 00 is the 32-bit one. 1

So the 32-bit binary starts from 0x1000 and ends at 0xd000 with a length of 0xc000.

  1. Extract the 32-bit mode binary using your favorite tools....(eg. dd) for me I like xxd as its syntax is easier to remember. Verify it by using "file java".

  2. Backup the original java binary.

  3. Replace the "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java" binary with the extracted 32-bit mode only binary in step 2.

  4. Test! If Java console is not shown, and there is no Java preference to turn it on, you can use the deployment.properties file at ~/Library/Caches/Java and add "deployment.console.startup.mode=SHOW".

Upvotes: 1

chesh
chesh

Reputation: 750

As far as I know, there has been an update from Apple made to disable Java plug-in and remove Java Preferences.app from the Utilities folder. You may need to re-enable the Java plugin.

And since Java 7 only runs 64-bit apps, the only solution you have is to follow these steps written by Apple to reinstall Java 6 :

http://support.apple.com/kb/HT5559?viewlocale=en_US

EDIT : Or, try to run Safari in 32-bit mode : steps here.

Upvotes: 1

Related Questions