line 56: /bin /java: no such file or directory

Ask questions about your setup or get help installing ZCS server (ZD section below).
xenhaxumus
Posts: 16
Joined: Fri Mar 09, 2018 2:51 am

line 56: /bin /java: no such file or directory

Postby xenhaxumus » Fri Mar 05, 2021 4:07 pm

hi i have this problem running zmprov. I don't know what else command I need to run or what path I need to take to solve it and be able to run zmprov. (/opt/zimbra/bin/zmjava: line 56: /bin /java: no such file or directory.) I run the required commands but cannot fix the problem. I have zimbra 8.7.11 opensource on ubuntu 16.04. Please someone help me with this.


java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~16.04-b08)
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

dpkg --list | grep -i jdk
ii default-jdk 2:1.8-56ubuntu2 amd64 Standard Java or Java compatible Development Kit
ii default-jdk-headless 2:1.8-56ubuntu2 amd64 Standard Java or Java compatible Development Kit (headless)
ii openjdk-8-jdk:amd64 8u282-b08-0ubuntu1~16.04 amd64 OpenJDK Development Kit (JDK)
ii openjdk-8-jdk-headless:amd64 8u282-b08-0ubuntu1~16.04 amd64 OpenJDK Development Kit (JDK) (headless)
ii openjdk-8-jre:amd64 8u282-b08-0ubuntu1~16.04 amd64 OpenJDK Java runtime, using Hotspot JIT
ii openjdk-8-jre-headless:amd64 8u282-b08-0ubuntu1~16.04 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)
ii oracle-java8-installer 8u201-1~webupd8~1 all Oracle Java(TM) Development Kit JDK) 8
ii oracle-java8-set-default 8u201-1~webupd8~1 all Set Oracle JDK 8 as default Java
ii zimbra-openjdk 1.8.0u172b01-1zimbra8.7b5.16.04 amd64 OpenJDK
ii zimbra-openjdk-cacerts 1.0.5-1zimbra8.7b1.16.04 all CA Certs keystore for OpenJDK

dpkg -l | grep openjdk
ii openjdk-8-jdk:amd64 8u282-b08-0ubuntu1~16.04 amd6 OpenJDK Development Kit (JDK)
ii openjdk-8-jdk-headless:amd64 8u282-b08-0ubuntu1~16.04 amd64 OpenJDK Development Kit (JDK) (headless)
ii openjdk-8-jre:amd64 8u282-b08-0ubuntu1~16.04 amd64 OpenJDK Java runtime, using Hotspot JIT
ii openjdk-8-jre-headless:amd64 8u282-b08-0ubuntu1~16.04 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)
ii zimbra-openjdk 1.8.0u172b01-1zimbra8.7b5.16.04 amd64 OpenJDK
ii zimbra-openjdk-cacerts 1.0.5-1zimbra8.7b1.16.04 all CA Certs keystore for OpenJDK

which java
/usr/bin/java

whereis java
java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz

find / -name java -type f -executable
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
/usr/lib/jvm/java-8-oracle/jre/bin/java
/usr/lib/jvm/java-8-oracle/bin/java
/opt/zimbra/common/lib/jvm/openjdk-1.8.0_172-zimbra/jre/bin/java
/opt/zimbra/common/lib/jvm/openjdk-1.8.0_172-zimbra/bin/java

if [[ -e "/opt/zimbra/common/bin/java" ]]; then echo "true"; else echo "Java is not found in /opt/zimbra"; exit 1; fi true

It is also possible that you have several versions of Java installed at the same time. I run this:

sudo update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Nothing to configure.

sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac)
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-oracle/bin/javac 1081 auto mode
1 /usr/lib/jvm/java-8-openjdk-amd64/bin/javac 1081 manual mode
* 2 /usr/lib/jvm/java-8-oracle/bin/javac 1081 manual mode
Press <enter> to keep the current choice[*], or type selection number:

sudo ln -s /usr/bin/java /opt/zimbra/common/bin/java
ln: failed to create symbolic link '/opt/zimbra/common/bin/java': File exists

sudo ls -hal /opt/zimbra/common/bin/java
lrwxrwxrwx 1 root root 24 May 28 2018 /opt/zimbra/common/bin/java -> ../lib/jvm/java/bin/java

sudo ls -la /opt/zimbra/common/bin/java

lrwxrwxrwx 1 root root 24 May 28 2018 /opt/zimbra/common/bin/java -> ../lib/jvm/java/bin/java

sudo ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 May 13 2019 /usr/bin/java -> /etc/alternatives/java

cat /etc/profile (If, it is required. I can send you the information)
cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre/bin/java"

cat .bashrc (If, it is required. I can send you the information)
cat .profile (If, it is required. I can send you the information)

su – zimbra
zmlocalconfig -q | grep '^zimbra.*home ='
zimbra_home = /opt/zimbra
zimbra_java_home = /opt/zimbra/common/lib/jvm/java

grep -i java .bashrc
JAVA_HOME=/opt/zimbra/common/lib/jvm/java
export JAVA_HOME
PATH=/opt/zimbra/bin:${JAVA_HOME}/bin:/opt/zimbra/common/bin:/opt/zimbra/common/sbin:/usr/sbin:${PATH}

cat .bashrc
JAVA_HOME=/opt/zimbra/common/lib/jvm/java
export JAVA_HOME
PATH=/opt/zimbra/bin:${JAVA_HOME}/bin:/opt/zimbra/common/bin:/opt/zimbra/common/sbin:/usr/sbin:${PATH}
export PATH

which java
/opt/zimbra/common/lib/jvm/java/bin/java
bash -x $(which zmprov) exit
+ source /opt/zimbra/bin/zmshutil
++ dirname /opt/zimbra/bin/zmprov
+ exec /opt/zimbra/bin/zmjava com.zimbra.cs.account.ProvUtil exit
/opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory

Will it be a problem in mysql? by source /bin/zmshutil; zmsetvars

there is more information in this file to show if needed


I need to migrate this server but with zmprov crashing I can't.
What other option is possible?


Klug
Elite member
Elite member
Posts: 2425
Joined: Mon Dec 16, 2013 11:35 am
Contact:

Re: line 56: /bin /java: no such file or directory

Postby Klug » Sun Mar 07, 2021 5:50 pm

Which version of Zimbra is running on this server?
xenhaxumus
Posts: 16
Joined: Fri Mar 09, 2018 2:51 am

Re: line 56: /bin /java: no such file or directory

Postby xenhaxumus » Tue Mar 09, 2021 4:37 pm

8.7.11 OS in Ubuntu 16.04

Return to “Installation and Upgrade”

Who is online

Users browsing this forum: No registered users and 6 guests