How can I check I’m running the latest Java?
If you have Java 9 installed, which is the current major version, there’ll be a Java icon in System Preferences. Click it and a separate window will open. Go to that window’s Update tab to see the version that’s installed and if updates are available. Or, type java --version in Terminal to see version details there.