Page 2 of 2

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

Posted: Fri Mar 01, 2019 11:49 pm
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?

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

Posted: Sat Mar 02, 2019 12:14 am
by xenhaxumus
/usr/lib/jvm
default-java java-1.8.0-openjdk-amd64 java-8-openjdk-amd64 java-8-oracle

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

Posted: Sun Mar 24, 2019 3:39 pm
by Rony
HI,

Configuration is correct.
I have the same issue with zmprov, I used instead zmprov -l ..... and it worked
Try it.

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

Posted: Mon Apr 08, 2019 2:03 pm
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

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

Posted: Thu Apr 11, 2019 9:03 pm
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,

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

Posted: Fri Nov 08, 2019 9:40 am
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

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

Posted: Sat Feb 06, 2021 6:52 pm
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: :?