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
Isn't it funny how there's always time and money enough to do it WRONG?
Joined: Jan 06, 2012
1) Yes I am doing the export $JAVA_OPTS
2) for running java $JAVA_OPTS other-parameters classname...will have to mention the jar file name for classname?