I have a Ubuntu machine where I already have one JDK version which is installed.
Next I have downloaded the second version into /usr/local.
Now, I want to run a program against the second JDK which is in /usr/local, i.e., I will copy a sample .java program in /usr/local/bin and then execute it.
But the problem is, even If I navigate to the /usr/local/bin and type $ java -version, I am getting the one which is installed in the first place. Is there any solution for this?