Skip to main content

OpenJDK 8 on cPanel DNSonly?

Comments

2 comments

  • cPanelMichael
    Hello :) Can you execute the following commands via SSH as root and share the output here? [CODE=rich]$ whmapi1 installed_versions packages=0|grep operating $ rpm -qa|grep jdk $ rpm -qa|grep java
    Thank you.
    0
  • KnTq
    Hello, I have allready solved this problem. First I renamed the folder /usr/bin/java to /usr/bin/java-temp (or anything else....latter I also deleted it) then update-alternatives --config java and it created the right symlink. But there was also another problem which was solved with help of a support request so I will post it here if anyone does have the same problem. Checking the "java" command using "which" shows the command being unable to be located: # which java /usr/bin/which: no java in (/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin) Checking for the "java" binary in the default location returned the following: # ls -lrt /usr/bin/java lrwxrwxrwx. 1 root root 22 Aug 23 15:38 /usr/bin/java -> /etc/alternatives/java # ls -lrt /etc/alternatives/java lrwxrwxrwx. 1 root root 73 Aug 23 15:38 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre/bin/java However, this file did not exist in the noted location. This broke the symlink and resulted in the command not functioning as expected: # ls -lrt /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre/bin/java ls: cannot access /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre/bin/java: No such file or directory Using "rpm" and a "for loop" I checked for the file within the currently installed RPM packages for "java-1.8.0-openjdk": # for i in $(rpm -qa | grep ^java\-1); do echo RPM: $i; rpm -ql $i | egrep java$; echo; done RPM: java-1.8.0-openjdk-devel-1.8.0.222.b10-0.el7_6.x86_64 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/bin/java RPM: java-1.8.0-openjdk-headless-1.8.0.222.b10-0.el7_6.x86_64 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre/bin/java RPM: java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64 As the file was indeed locaated within "java-1.8.0-openjdk-headless-1.8.0.222.b10-0.el7_6.x86_64" I went ahead and reinstalled this RPM using "yum": # yum reinstall java-1.8.0-openjdk-headless-1.8.0.222.b10-0.el7_6.x86_64 Installed: java-1.8.0-openjdk-headless.x86_64 1:1.8.0.222.b10-0.el7_6 Complete! Now when checking for the file, running the "java -version" command, and checking for "java" using "which" all return as expected: # ls -lrt /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre/bin/java -rwxr-xr-x. 1 root root 7376 Jul 23 19:03 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre/bin/java # java -version openjdk version "1.8.0_222" OpenJDK Runtime Environment (build 1.8.0_222-b10) OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode) # which java /usr/bin/java
    0

Please sign in to leave a comment.