Hi All
Just have a doubt in running the script... I need to run two scripts... Am first running the setenv.sh as ./setenv.sh and the next script as ./script.sh.But after i run script.sh am getting an error as JAVA_HOME not set. I tried running the setenv.sh as
. ./setenv.sh and ran ./script.sh and it does not give any error... am wondering what might be the problem...
Contents of setenv.sh
Code:
#!/bin/bash
export PATH=/home/test/142_16/bin:$PATH
export JAVA_HOME=/home/test/142_16
Contents of script.sh
Code:
#!/bin/bash
CLASSPATH=.:lib/classes12.jar:lib/SSEPrinthouseFeed.jar
if [ -n "$JAVA_HOME" ];then
if [ -x "$JAVA_HOME/bin/java" ] ; then
JAVACMD=$JAVA_HOME/bin/java
else
echo "$JAVA_HOME does not seem to contain an executable java - please check before running $0"
exit 1
fi
else
echo "JAVA_HOME not set - ensure this is set correctly before running $0"
exit 1
fi
./alert.sh
exit 0