How to install java.pkg (not unarchiver)
The Java installer is a package which installs using Installer. If the package doesn't open by default with Installer then right-click it and choose Open With → Installer.