Skip to content

Instantly share code, notes, and snippets.

@ewrfedf
Forked from sam/gist:2778268
Created March 13, 2017 10:02
Show Gist options
  • Save ewrfedf/abe0e66beb7a5fa50f9a2ab31ba963e3 to your computer and use it in GitHub Desktop.
Save ewrfedf/abe0e66beb7a5fa50f9a2ab31ba963e3 to your computer and use it in GitHub Desktop.
Install OpenJDK7 on OSX
if ! [ -d /Library/Java/JavaVirtualMachines/1.7.0u6.jdk ]; then
echo "Downloading OpenJDK 7"
curl -o /tmp/OpenJDK-7.dmg http://openjdk-osx-build.googlecode.com/files/OpenJDK-OSX-1.7-universal-u-jdk-jdk7u6-b10-20120522.dmg
echo "Attaching DMG image"
hdiutil attach /tmp/OpenJDK-7.dmg
echo "Copying JDK into available Java Virtual Machines"
sudo cp -R /Volumes/OpenJDK\ 7\ \(Mac\ OS:X\ Port\)/1.7.0u.jdk /Library/Java/JavaVirtualMachines/1.7.0u6.jdk
echo "Detach DMG image"
hdiutil detach /Volumes/OpenJDK\ 7\ \(Mac\ OS:X\ Port\)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment