0

I am using Linux Debian and I can see that JAVA_HOME is setup. I downloaded wso2am-2.0.0.zip, unziped and I try to start the application as described in

https://docs.wso2.com/display/AM170/Running+the+Product

Any idea what else to check will be appreciated.

nodejs bin # echo $PATH
/usr/lib/jvm/java-7-oracle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/share/logstash:/usr/share/logstash/bin
nodejs bin # echo $JAVA_HOME
/usr/lib/jvm/java-7-oracle
nodejs bin # java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
nodejs bin # pwd
/home/demetrio/ParaAvaliar/wso2am-2.0.0/bin
nodejs bin # sh wso2server.sh
Error: JAVA_HOME is not defined correctly.
 CARBON cannot execute java
nodejs bin # 
DemeCarvO
  • 487
  • 4
  • 16
  • 28
  • can you use the JDK? – Jorge Infante Osorio Feb 01 '17 at 20:34
  • What is the output of `which java`? – Kasun Gajasinghe Feb 02 '17 at 10:53
  • nodejs bin # ls -l `which java` -rwxr-xr-x 1 root root 7718 Jan 20 16:30 /usr/lib/jvm/java-7-oracle/bin/java nodejs bin # which java /usr/lib/jvm/java-7-oracle/bin/java nodejs bin # – DemeCarvO Feb 02 '17 at 12:15
  • Jorge, as far as I understand, I am using JDK so far. I read somewhere that wso2 isn't compliance neither with OpenJdk nor Java version 8 so I am using Java 7 provided by Oracle. I am not expert in linux. Supposing you were facing this and you would want to update your JDK. How would you do it in Debian and how would you set up all system variables that wso2 relies on? – DemeCarvO Feb 02 '17 at 12:19
  • It would worth a try defining `JAVA_HOME`. Something like this: `Tmp=$(dirname $(which java)); echo export JAVA_HOME=${Tmp%/bin}` Note: even `export` doesn't help, if the script unsets `JAVA_HOME` – Lorinczy Zsigmond Feb 03 '17 at 09:25

1 Answers1

0

Certainly it is more related to Linux skills then wso2 but maybe it is going to be useful for future users. I changed JAVACMD to point to the default JDK instalatio which comes with Debian without relying on JAVA_HOME variable.

mcedit ./bin/wso2server.sh or xed ./bin/wso2server.sh

if [ -z "$JAVACMD" ] ; then
  if [ -n "$JAVA_HOME"  ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
      # IBM's JDK on AIX uses strange locations for the executables
      JAVACMD="$JAVA_HOME/jre/sh/java"
    else
#      JAVACMD="$JAVA_HOME/bin/java"
      JAVACMD="/usr/bin/java"
    fi
  else
    JAVACMD=java
  fi
fi
DemeCarvO
  • 487
  • 4
  • 16
  • 28
  • I've just checked my AIX computer (different java versions: 5, 6, 7.1, 8), there is no such `$JAVA_HOME/jre/sh` directory in any of them, just plain simple $JAVA_HOME/bin/` (and `$JAVA_HOME/jre/bin/`) – Lorinczy Zsigmond Feb 03 '17 at 09:20