title: Java - Get server absolute path
body: <p>How to get the absolute path of server location in my machine?</p>
  
  <p>Suppose I am using glassfish server then I need to get absolute path of glassfish docroot location as below:</p>
  
  <pre><code>C:\glassfish3\glassfish\domains\domain1\docroot
  </code></pre>
  
  <p>At run time, I need to create file on that location using java io package like:</p>
  
  <pre><code>C:\glassfish3\glassfish\domains\domain1\docroot\myfile.txt
  </code></pre>