I installed java before and i am running java applications on Centos, it is located at /usr/bin/java. For some other reason i want to install it to another location, let's say /myDirectory/java I downloaded java jdk as tar file and extract it to /myDirectory this directory then i set JAVA_HOME accordingly.
The problem is i can't start the applications anymore, the log says :
ERROR: JAVA_HOME is set to an invalid directory: /myDirectory/jdk1.8.0_181/bin/java
Please set the JAVA_HOME variable in your environment to match the location of your Java installation.
Is it because i had a prior installation? How do i achive this? Any help would be aprreciated, thanks.