any way to find out the physical location of the class file at runtime?
Joined: Mar 18, 2003
I wanna know there is a way to find out the physical location of the class file at runtime??
I tried "(new File(".")).getCanonicalPath()", but it returns only the "root" directory of where "javaw" is executed: "/user/domains/mydomain" what I need is something like: "/user/my_project/webapp/WEB-INF/classes/test/framework/testClass"!!
appreciate any help!
Joined: Mar 03, 2004
I wonder why you want that kind of information. The Java class may be a file located in a zip, jar, war, ear, folder or else or could even not be a file at all. Anyway you could try something like this: