title: Java Classpath in context
body: <p>I'm writing a program, which needs to known all classes/jars in its context. For example if it runs in a Maven environment, it must know the path to all of the dependent jars in .m2/. If it runs in Tomcat, it must know the jars in <code>WEB-INF/lib/</code>. It should do this automatically, without any configuration. I have used <code>System.getProperty("java.class.path")</code> but it does not work in Tomcat.</p>