In Eclipse you can configure numerous servers to run inside the IDE, including Tomcat. Depending on your Tomcat configuration, at some point in the life cycle of a webapp your J
The easiest way is most likely to ask a compiled JSP page about the source of the byte code.
From http://www.exampledepot.com/egs/java.lang/ClassOrigin.html:
// Get the location of this class
Class cls = this.getClass();
ProtectionDomain pDomain = cls.getProtectionDomain();
CodeSource cSource = pDomain.getCodeSource();
URL loc = cSource.getLocation(); // file:/c:/almanac14/examples/
Hopefully this helps. What is it you want to do?