Article 4TQHY Proper way to setup environment variables

Proper way to setup environment variables

by
shogun1234
from LinuxQuestions.org on (#4TQHY)
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_OPTSor
Code:JAVA_OPTS="..."; java -cp ... $JAVA_OPTSI 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.

Thankslatest?d=yIl2AUoC8zA latest?i=K4gCEGdvUHg:M9_20rQC3eo:F7zBnMy latest?i=K4gCEGdvUHg:M9_20rQC3eo:V_sGLiP latest?d=qj6IDK7rITs latest?i=K4gCEGdvUHg:M9_20rQC3eo:gIN9vFwK4gCEGdvUHg
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments