Summarize this article:

This will open a search bar allowing you to search your computer. As you type, search results will filter below the search bar. It's the icon of a small black box with a white command prompt in the corner. This will open your Mac's Terminal. This command will tell you what version of Java your Mac is currently running.
Click Spotlight in the top-right of the menu bar. Enter Terminal in the search bar. Double-click Terminal . Type java -version and press Return.