/opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
xenhaxumus
Posts: 17
Joined: Fri Mar 09, 2018 2:51 am

Re: /opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory

Post by xenhaxumus »

I want to comment on something, reviewing the contents, when executing this command: grep -i java .bashrc

These lines do not have them in my file
which java
common/lib/jvm/java/bin/java
type java
java is /opt/zimbra/common/lib/jvm/java/bin/java


when executing this command: env |grep -i java
I have these other lines of more
DERBY_HOME=/usr/lib/jvm/java-8-oracle/db
JAVA_HOME=/opt/zimbra/common/lib/jvm/java
J2SDKDIR=/usr/lib/jvm/java-8-oracle
J2REDIR=/usr/lib/jvm/java-8-oracle/jre


java -version
openjdk version "1.8.0_172-zimbra"
OpenJDK Runtime Environment (build 1.8.0_172-zimbra-b01)
OpenJDK 64-Bit Server VM (build 25.172-b01, mixed mode)

Return to the backup of zmjava and execute the command again: 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

and
bash -x /opt/zimbra/bin/zmjava com.zimbra.cs.account.ProvUtil exit
++ dirname /opt/zimbra/bin/zmjava
+ source /opt/zimbra/bin/zmshutil
+ zmsetvars -f
+ '[' x-f = x-f ']'
+ shift
+ zmlocalconfig=/opt/zimbra/bin/zmlocalconfig
+ '[' '!' -x /opt/zimbra/bin/zmlocalconfig ']'
+ export zmsetvars=true
+ zmsetvars=true
+ '[' -d /jre ']'
+ JRE_EXT_DIR=/lib/ext
+ '[' -f .hotspot_compiler ']'
+ case "`uname`" in
++ uname
+ PATHSEP=:
+ ZIMBRA_EXTENSIONS='backup clamscanner network zimbra-license zimbrahsm zimbrasync twofactorauth com_zimbra_ssdb_ephemeral_store'
+ ZIMBRA_EXT_DIR=/opt/zimbra/lib/ext-common
+ for i in '$ZIMBRA_EXTENSIONS'
+ '[' -d /opt/zimbra/lib/ext/backup ']'
+ for i in '$ZIMBRA_EXTENSIONS'
+ '[' -d /opt/zimbra/lib/ext/clamscanner ']'
+ ZIMBRA_EXT_DIR=/opt/zimbra/lib/ext-common:/opt/zimbra/lib/ext/clamscanner
+ for i in '$ZIMBRA_EXTENSIONS'
+ '[' -d /opt/zimbra/lib/ext/network ']'
+ for i in '$ZIMBRA_EXTENSIONS'
+ '[' -d /opt/zimbra/lib/ext/zimbra-license ']'
+ ZIMBRA_EXT_DIR=/opt/zimbra/lib/ext-common:/opt/zimbra/lib/ext/clamscanner:/opt/zimbra/lib/ext/zimbra-license
+ for i in '$ZIMBRA_EXTENSIONS'
+ '[' -d /opt/zimbra/lib/ext/zimbrahsm ']'
+ for i in '$ZIMBRA_EXTENSIONS'
+ '[' -d /opt/zimbra/lib/ext/zimbrasync ']'
+ for i in '$ZIMBRA_EXTENSIONS'
+ '[' -d /opt/zimbra/lib/ext/twofactorauth ']'
+ ZIMBRA_EXT_DIR=/opt/zimbra/lib/ext-common:/opt/zimbra/lib/ext/clamscanner:/opt/zimbra/lib/ext/zimbra-license:/opt/zimbra/lib/ext/twofactorauth
+ for i in '$ZIMBRA_EXTENSIONS'
+ '[' -d /opt/zimbra/lib/ext/com_zimbra_ssdb_ephemeral_store ']'
+ ZIMBRA_EXT_DIR=/opt/zimbra/lib/ext-common:/opt/zimbra/lib/ext/clamscanner:/opt/zimbra/lib/ext/zimbra-license:/opt/zimbra/lib/ext/twofactorauth:/opt/zimbra/lib/ext/com_zimbra_ssdb_ephemeral_store
+ java_options=-XX:ErrorFile=/opt/zimbra/log
+ '[' x = x ']'
+ zimbra_zmjava_java_library_path=/opt/zimbra/lib
+ '[' x = x ']'
+ zimbra_zmjava_java_ext_dirs=/lib/ext:/opt/zimbra/lib/jars:/opt/zimbra/lib/ext-common:/opt/zimbra/lib/ext/clamscanner:/opt/zimbra/lib/ext/zimbra-license:/opt/zimbra/lib/ext/twofactorauth:/opt/zimbra/lib/ext/com_zimbra_ssdb_ephemeral_store
+ exec /bin/java -XX:ErrorFile=/opt/zimbra/log -client -Dzimbra.home=/opt/zimbra -Djava.library.path=/opt/zimbra/lib -Djava.ext.dirs=/lib/ext:/opt/zimbra/lib/jars:/opt/zimbra/lib/ext-common:/opt/zimbra/lib/ext/clamscanner:/opt/zimbra/lib/ext/zimbra-license:/opt/zimbra/lib/ext/twofactorauth:/opt/zimbra/lib/ext/com_zimbra_ssdb_ephemeral_store com.zimbra.cs.account.ProvUtil exit
/opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory

https://computingforgeeks.com/fix-zimbr ... localhost/
In this url says something of the previous error modify it from false to true
zimbra_zmprov_default_to_ldap = false change it to true
zimbra_zmprov_default_to_ldap = true

My question is the following one I must modify some of these archives: .bashrc, zmjava, localconfig.xml, zmlocalconfig, zmutils or others or some other directory?
xenhaxumus
Posts: 17
Joined: Fri Mar 09, 2018 2:51 am

Re: /opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory

Post by xenhaxumus »

/usr/lib/jvm
default-java java-1.8.0-openjdk-amd64 java-8-openjdk-amd64 java-8-oracle
User avatar
Rony
Posts: 45
Joined: Fri Jan 27, 2017 3:50 pm
Location: Canada-Montreal
ZCS/ZD Version: Zimbra 9.0.0_GA_4174
Contact:

Re: /opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory

Post by Rony »

HI,

Configuration is correct.
I have the same issue with zmprov, I used instead zmprov -l ..... and it worked
Try it.
xenhaxumus
Posts: 17
Joined: Fri Mar 09, 2018 2:51 am

Re: /opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory

Post by xenhaxumus »

Thanks for your answer, I already tried

For example with this command:

zimbra@:~$ zmprov -l ma count@xxx zimbraAccountStatus active
/opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory
User avatar
DualBoot
Elite member
Elite member
Posts: 1326
Joined: Mon Apr 18, 2016 8:18 pm
Location: France - Earth
ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
Contact:

Re: /opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory

Post by DualBoot »

Hello,

why did you install Oracle JVM on your server ? You should purge this and try to test again the zmprov command.

Regards,
ashmuh
Posts: 1
Joined: Fri Nov 08, 2019 9:37 am

Re: /opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory

Post by ashmuh »

you might be running the command as some other user. You should be running the command as zimbra user .Otherwise export the variable
xenhaxumus
Posts: 17
Joined: Fri Mar 09, 2018 2:51 am

Re: /opt/zimbra/bin/zmjava: line 56: /bin/java: No such file or directory

Post by xenhaxumus »

Hi, I need to migrate my server to a new server and I still have this problem. They will have some way of telling me what to do. Thank you :shock: :roll: :?
Post Reply