On my Solaris 11 server I have created an entry in the root user CRON tab to launch a groovy based application every weekend. The application runs fine under a non-root user. When run by CRON however, the following error message gets emited:
groovy: JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME
Which is weird, as I have the following lines at the end of my /etc/profile file:
JAVA_HOME=/usr/jdk/instances/jdk1.7.0
export JAVA_HOME
GROOVY_HOME=/usr/local/bin/groovy-2.1.3
export GROOVY_HOME
PATH=${PATH}:${GROOVY_HOME}/bin:${JAVA_HOME}/bin
export PATH
Please advice me where to look for the cause of this problem.
Thank you in advance,
Dusan