So I've run into a bit of an issue. My workplace uses environmental variables on it's machines and we've recently switched our dev / prod servers to unix-based solutions (RHEL 6) and we're trying to get some of our old programs to run with a cron. The envir variables are running on the box itself (Example: Server1=dev-server.intranet.net or something along those lines) but we're running into issues where a cron is in place.
Example.
java -jar MyProgram.jar -- Works fine
MyProg.sh - Works fine
JAVA_HOME=/usr/data/java/current
PATH=$JAVA_HOME/bin
export JAVA_HOME
export PATH
java -jar /usr/data/apps/MyProg/MyProg.jar
When calling MyProg.sh from a cron, it doesn't work, as it can't see the envir variables at all.
Can someone offer some insight to how to make this work with a cron?
Thanks.