In command line, I understand I can export environment variable by
export. For instance,
Code:
$ export JAVA_OPTS="..."
$ java -cp ./ $JAVA_OPTS ...
But sometimes I seems to see some usage such
Code:
env JAVA_OPTS="..."; java -cp ... $JAVA_OPTS
or
Code:
JAVA_OPTS="..."; java -cp ... $JAVA_OPTS
I can't remember the exact way those commands to export environment variables (so I believe the syntax I use could be wrong). Thus I am interested to learn what's a more appropriate way to export environment variables or (if it's just different syntax as unix allows different approach the goal by different ways) the differences between those syntax.
Thanks