The easiest way to determine what java installations you currently have installed is by running:
/usr/libexec/java_home
This will return the default Java jdk you currently have installed. You could also run:
java -v
Which will show you the current version of the first JDK that your path encounters.
If you would like to view all Java JDK versions that you have installed, you can run the first command mentioned with the -V (verbose) flag, and it will list the paths to all you have installed.
If you have multiple versions installed, you can amend your $PATH variable inside either .bashrc or .bash_profile. (Note these are the files for my system, macOS, but the profile files may be different for Linux installations, I simply do not know). There is a convention you can read about regarding where you should do it.
Quite simply, if the version you do NOT want is the one that appears when you run java -v or which java then you must add the path to the desired JDK to your $PATH as mentioned.
In order to view your current path, you can run echo $PATH
In order to amend your path you will add a command similar to the following to one of the bash profile files for your system:
export PATH=$PATH:/[NEW_PATH]
or
export PATH=[DESIRED_PATH]:$PATH
The first command adds to the end of your path, the second adds to the beginning.
Most likely you may want to add the path to your desired JDK in the beginning of your existing $PATH variable.
Obviously, be very careful with changing your path, you don't want other programs to break, so make sure you simply add the desired JDK path in front of your original variable, so that the only related program, java, has a change.
ls -l /usr/bin/java. Since java_home works, I wonder if your 'java' simlink is pointed at the wrong thing or doesn't exist. Both can give you a command not found.