I tried updating to the latest version of JRE and I checked my Java Control Panel and it says I have the latest version. But when I go on my terminal and checked by typing
java -version
I'm getting
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
However, when I checked the version by typing
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
I did get the correct version:
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
What can I do to make sure I am running version 1.8? I need it to run elasticsearch and I've been pulling my hair out over the right version of java on my machine (Mac).