3 Replies Latest reply: Jun 27, 2013 9:52 AM by Pascal Kreyer-Oracle RSS

    JAVA_HOME not set when running a task via CRON

    931834

      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