- Download and mount the DMG for the JDK (in my case Java 8u291)
- Copy the package file in a temp folder
- Open a terminal and extract the package file in the temp folder:
pkgutil --expand JDK\ 8\ Update\ 291.pkg JDK8u291
- cd into the extracted folder
- There is a jdk1.x.x_xxx.pkg file in the folder, but it's just a folder so open it
Unarchive the file
Payloadwith the archive utility
open Payloador just use "Open with Archive Utility" in finder
Contents/homefolder somewhere where you want your JDKs to be located
cp Contents/Home ~/Library/Java/JavaVirtualMachines/jdk8u291-oracle
And done :). No installer, no updater no changed environment.
Bonus: Install the JDK for use with SDKMAN!
sdk install java 8.0.291-oracle ~/Library/Java/JavaVirtualMachines/jdk8u291-oracle