The java on your mac can easily become outdated. Apple doesn't love java, so the auto tools to "update" it often don't work. Here's how you can check which version you're currently on, and how to remove it.
Note: the current version of Java JDK is V10. (8/23/18) found here.
Check the current version:
I like the stable Java Version 8. Found here.
Having trouble with making the directions in a post work? just click...