This does not work as expected when I execute the jar file on Unix. Is there any other way that I set the variable for jar in Unix?
On windows, I can set this up in Computer>>Properties>>Advanced>>Environment variables.
I could set up this variable for tomcat on Unix as well but for some reason jar file does not read the variables.
Shinaya Seth wrote:This does not work as expected when I execute the jar file on Unix.
I have to admit I'm not familiar with JAVA_OPTS, but two possibilities:
1. did you include export JAVA_OPTS in the .bash_profile? Or alternatively, use
export JAVA_OPTS="-Djava.awt.headless=true -Dvariable1=file:/home/file.xml -Dvariable2=file:/home/file2.properties"
2. You may still need to execute something like java $JAVA_OPTS other-parameters classname
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here