I have a java web service (.war file) that I deploy to a few different environments, namely Apache Tomcat 7.0.x and JBoss EAP 6.1.x. When I open a File object (File file = new File("./test.file");), the absolute path is different based on which application server I am using. I output the absolute path by calling file.getAbsolutePath().
For Tomcat, it appears to look for test.file in the Tomcat/bin directory, but for my instance of JBoss EAP, it looks for /test.file, i.e. system root.
Is there some configuration parameter or environment variable for either of these two application servers that dictates the working directory?
 
     
     
    