My MacOS Sierra version number 10.12.2, the JRE package installed is: JRE-8U112-MACOSX-X64.DMG
After you double-click Normal installation, entering java-version under terminal does not display the version properly, you need to configure environment variables.
Here's how:
Open Terminal, enter the following to create a profile in the current user directory:
VI ~/.bash_profile
Click the I key to enter edit mode, paste the following content:
Java_home= "/Library/Internet Plug-ins/javaappletplugin.plugin/contents/home"
Path= $JAVA _home/bin: $PATH
Classpath=.: $JAVA _home/lib
Export Java_home
Export CLASSPATH
Export PATH
Then click the ESC key, enter: Wq Save exit
Finally, run the command update under Terminal to make the configuration effective:
source. Bash_profile
Enter java-version under Terminal to display the version successfully, if not, please log out.
MacOS Sierra installation JRE8, configuring environment variables