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: URL clsURL = getClass().getResource("/" + getClass().getName().replace('.', '/') + ".class"); if (clsURL.getProtocol().equals("jar")) { JarURLConnection jarConn = (JarURLConnection)clsURL.openConnection(); System.out.println("Jar file location ...