I would like to install the dmg java package in my MAC OS through the terminal
I tried using this command:
sudo installer -package jdk-7u51-macos-x64.dmg
Try this:
MOUNTDIR=$(echo `hdiutil mount jdk-7u51-macos-x64.dmg | tail -1 \ | awk '{$1=$2=""; print $0}'` | xargs -0 echo) \ && sudo installer -pkg "${MOUNTDIR}/"*.pkg -target /