public static Path find(Class<?> clazz) {
        requireNonNull(clazz, "clazz");

        final ProtectionDomain pd = clazz.getProtectionDomain();
        if (pd == null) {
            throw new IllegalArgumentException(clazz + " does not have a protection domain.");
        }
        final CodeSource cs = pd.getCodeSource();
        if (cs == null) {
            throw new IllegalArgumentException(clazz + " does not have a code source.");
        }
        final URL url = cs.getLocation();
        if (url == null) {
            throw new IllegalArgumentException(clazz + " does not have a location.");
        }

        if (!"file".equalsIgnoreCase(url.getProtocol())) {
            throw new IllegalArgumentException(clazz + " is not on a file system: " + url);
        }

        File f;
        try {
            f = new File(url.toURI());
        } catch (URISyntaxException ignored) {
            f = new File(url.getPath());
        }

        final Path path = f.toPath();
        if (!Files.isDirectory(path) && !isZip(path)) {
            throw new IllegalArgumentException(f + " is not a JAR, WAR or directory.");
        }

        return path;
    }
Returns the {@link Path} to the JAR, WAR or directory where the specified {@link Class} is located at.
core/src/main/java/com/linecorp/armeria/common/util/AppRootFinder.java