I've tried everything I can think and searched high and low for solutions of but I can't get JAVA_HOME into cron to run anything java periodically.
gives me everything you'd expect. 'which java' prints '/usr/bin/java'
I'm also running Java applications fine from bash scripts launched in terminal.
I want to run them periodically from cron but it is refusing to.
PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-sun/bin JAVA_HOME=/usr/lib/jvm/java-6-sun * * * * * /bin/bash --version > /tmp/b.log * * * * * /usr/bin/java -version > /tmp/j.log
Which fills b.log with text but j.log is empty.
I have also tried adding export JAVA_HOME=/usr/lib/jvm/java-6-sun to the top of scripts as well but no dice.