also looking for two lines of code to access the Tomcat directory seamlessly?
Works for any environment variable o' course...

public static void main(String args) {
String tomcatHome = System.getenv("TOMCAT_HOME");
System.out.println("Tomcat Home vaut : "+tomcatHome);
}