private static Path identifyRunningJarPath() throws IOException {
        final URI uri;
        try {
            uri = SelfUpdate.class.getProtectionDomain().getCodeSource().getLocation().toURI();
        } catch (final URISyntaxException ex) {
            throw new IOException("URI of the Embulk installation path is invalid", ex);
        }
        final Path path = Paths.get(uri);

        // The check was against Gem-based Embulk. but it is not effective now as Gem versions are no longer available.
        // TODO: Check installation with multiple JAR files with dependencies.
        if ((!Files.exists(path)) || (!Files.isRegularFile(path))) {
            throw new IOException("This Embulk installation is not an all-in-one JAR. \"selfupdate\" does not work");
        }
        return path;
    }
Runs the selfupdate subcommand of Embulk.

<p>It uses {@link java.net.HttpURLConnection} so that CLI classes do not need additional dependedcies.

<p>TODO: Support HTTP(S) proxy. The original Ruby version did not support as well, though.
embulk-core/src/main/java/org/embulk/cli/SelfUpdate.java