|
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
public class FindClass {
public static void main(String[] args) {
try {
URLClassLoader loader = new URLClassLoader(
new URL[] {new File("/wintouch/tomcat/lib/catalina.jar").toURI().toURL()});
loader.loadClass(args[0]);
System.out.println("URLClassLoader found class '" +args[0] +"'");
}
catch (Exception e) {
e.printStackTrace();
}
}
}
java FindClass org.apache.catalina.startup.Catalina URLClassLoader found class 'org.apache.catalina.startup.Catalina'
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.