Java tutorial
//package com.java2s; import java.io.IOException; import java.net.URL; public class Main { /** * @param url The path to inspect. * @return TRUE if the passed URL is contained in a JAR file. * @throws IOException */ public static boolean isUrlInJar(URL url) throws IOException { return url == null ? false : url.toString().startsWith("jar:"); } }