0

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.

İlker Demirci
  • 243
  • 1
  • 3
  • 12

1 Answers1

0

ERROR: JAVA_HOME is set to an invalid directory: /myDirectory/jdk1.8.0_181/bin/java

Your error suggests you set JAVA_HOME to the path of the java binary, but JAVA_HOME must point to the JDK directory, not the binary, i.e. JAVA_HOME=/myDirectory/jdk1.8.0_181, without /bin/java.

criztovyl
  • 761
  • 5
  • 21