Skip to content

Instantly share code, notes, and snippets.

@RichoDemus
Created March 21, 2018 13:19
Show Gist options
  • Save RichoDemus/aa0ef79962ac7c2e4e059d450b7067dc to your computer and use it in GitHub Desktop.
Save RichoDemus/aa0ef79962ac7c2e4e059d450b7067dc to your computer and use it in GitHub Desktop.
Details on how to extract java from the dmg-file so you don't have to run the oracle installer on MacOS

Unpacking JDK on MacOS

Steps

  1. Download the installer .dmg files. They contain the good stuff.
  2. Mount the .dmg and copy the .pkg file to somewhere
  3. Open a terminal and cd to the folder you copied the .pkg file into pkgutil --expand JDK\ 7\ Update\ 60.pkg JDK7u60 - extract pkg file to folder
  4. cd JDK7u60/ - move to the extracted pkg
  5. cd jdk17060.pkg/ - there's a folder with the version number ending with .pkg (but it's just a folder), go there
  6. Unpack Payload using Archive Utility (use "Open with" in finder), it's located at /System/Library/CoreServices/Applications
  7. Copy the jdk to where you want it and set JAVA_HOME
  8. Done!

Credits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment