Jump to content
antiben

mountain lion java 7 only

Recommended Posts

here is a way to setup oracle's java 7 to run bundled apps

like the 'DSDT Editor' without install java 6 from apple


download java from oracle and install jdk-7u25-macosx-x64.dmg...


now, we have to create some folder/links for the missing jvm server lib and

have to add at least the 'jni' and 'app bundled' capabilities into the package info.


here's my bash history after the installation:

cd /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/
sudo ln -s ../ bundle
cd bundle
sudo mkdir Libraries
cd Libraries
sudo ln -s ../Home/jre/lib/server/libjvm.dylib libserver.dylib
sudo /usr/libexec/PlistBuddy -c "Add :JavaVM:JVMCapabilities:1 string JNI" /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Info.plist 
sudo /usr/libexec/PlistBuddy -c "Add :JavaVM:JVMCapabilities:2 string BundledApp" /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Info.plist 

now the 'JavaApplicationStub' seems to work with java 7...

you may have to edit the java applications Info.plist and point to JVMVersion 1.7


these version numbers may change like jdk...jdk,

but uninstalling seems easy... for example, to uninstall 7u6:

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk

these values are inside the lastest apple 1.6 jdk

<key>JVMCapabilities</key>
<array>
<string>JNI</string>
<string>BundledApp</string>
<string>WebStart</string>
<string>Applets</string>
<string>CommandLine</string>
</array>


// edit

if you want the java preferences back in utilities, just

get and mount JavaForMacOSX10.6Update3.dmg from apple

mkdir ~/Desktop/java6u3
xar -xf /Volumes/Java\ For\ Mac\ OS\ X\ 10.6\ Update\ 3/JavaForMacOSX10.6Update3.pkg -C ~/Desktop/java6u3
cd ~/Desktop/java6u3/JavaForMacOSX10.6Update3.pkg/
cat Payload | gunzip -dc | cpio -i
sudo mv Applications/Utilities/Java\ Preferences.app /Applications/Utilities/
cd ~/Desktop/
rm -rf java6u3

// edit 2

some apps still have the 32-bit stub :/

to get the 64-bit java stub i downloaded JavaForOSX2013-004.dmg ...

mkdir ~/Desktop/java64
xar -xf /Volumes/Java\ for\ OS\ X\ 2013-004/JavaForOSX.pkg -C ~/Desktop/java64
cd ~/Desktop/java64/JavaEssentials.pkg/
cat Payload | gunzip -dc | cpio -i
mv System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub ~/Desktop/
cd ~/Desktop/
rm -rf java64

cause this file has the x86_64 arch

file JavaApplicationStub 
JavaApplicationStub: Mach-O universal binary with 2 architectures
JavaApplicationStub (for architecture x86_64):	Mach-O 64-bit executable x86_64
JavaApplicationStub (for architecture i386):	Mach-O executable i386

now replace the stub and add 'x86_64' to the 'JVMArchs' array inside the applications info.plist…

(/usr/libexec/PlistBuddy -c "Add :Java:JVMArchs:0 string 'x86_64'" ...)

xio antiben

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.





×
  • Create New...