Here you can find the source of classExists(String className)
public static boolean classExists(String className)
//package com.java2s; //License from project: Apache License public class Main { public static boolean classExists(String className) { try {//from w w w . ja v a2s . c o m forName(className); return true; } catch (Exception e) { return false; } } public static Class<?> forName(String name) { return forName(name, null); } public static Class<?> forName(String name, ClassLoader loader) { try { if (loader == null) { return Class.forName(name); } return Class.forName(name, true, loader); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } }