title: Is it possible to use environment variables in java options file?
body: <blockquote>
    <p>Specifying Java options and system properties You can specify Java™
    options and system properties on the command line, by using an options
    file, or by using an environment variable.
    ...
    2.By creating a file that contains the options, and specifying it on the command line using -Xoptionsfile=file.</p>
  </blockquote>
  
  <p><a href="http://publib.boulder.ibm.com/infocenter/realtime/v1r0/topic/com.ibm.rt.doc.10/user/specifying_options.html" rel="nofollow">http://publib.boulder.ibm.com/infocenter/realtime/v1r0/topic/com.ibm.rt.doc.10/user/specifying_options.html</a>  </p>
  
  <p>I specified following options in options file:  </p>
  
  <pre><code>-Xdump:what
  -Xdump:java:none
  -Xdump:heap:none
  -Xdump:system:none
  -Xdump:snap:none
  -Xdump:java:events=user,range=1..2,file=$TRACEDIR/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt
  -Xdump:heap:events=user,range=1..2,file=$TRACEDIR/heapdump.%Y%m%d.%H%M%S.%pid.%seq.phd
  </code></pre>
  
  <p>But JVM does not evaluate environment variable $TRACEDIR.<br>
  If I do not use options file, but just add these options to command line then JVM evaluates environment variable.<br>
  Whe there is such difference?</p>
  
  <p><strong>ANSWER:</strong><br>
  Command line preprocessor evaluates environment variables if you use them in command line.  Not JVM.  </p>