Here you can find the source of classForName(String className)
public static Class<?> classForName(String className)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { public static Class<?> classForName(String className) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); try {/*from w ww .j a v a 2s .c o m*/ return Class.forName(className, true, cl); } catch (Throwable ex) { try { Class.forName(className, true, cl); } catch (Exception ex2) { } throw new RuntimeException("Failed to load class: " + className + "; " + ex.getMessage(), ex); } } public static <T> Class<T> classForName(String className, Class<T> ifacecls) { return (Class<T>) classForName(className); } }