Thursday, October 18, 2012

JAVA relative path issue in CRONTAB

It can be occurred issues relative to files access when you have used relative path in JAVA application which are used by crontab in linux. crontab cannot be used in relative paths. One solution is to change JAVA application file access to FULL paths. Another solution is to create shell script as follows. Then, this script can be used by crontab without issues.

#!/bin/bash
cd /home/sujith/app_location
/usr/jdk1.7.0_07/bin/java -jar -Xms512m -Xmx1024m app_name.jar