making class accessible from class path in dynamic class loading

Posted by Noona on Stack Overflow See other posts from Stack Overflow or by Noona
Published on 2010-05-17T23:16:35Z Indexed on 2010/05/17 23:20 UTC
Read the original article Hit count: 709

Filed under:
|

I have a project created in Eclipse, and I defined an interface and a class for dynamic class loading, the class is in the project directory, so I have this code in my project:

if (handlerClassName != null) 
    {
         TypeHandler typeHandler = null;
         try {
             typeHandler = (TypeHandler) 
            (Class.forName(handlerClassName).newInstance());

but I get this exception: java.lang.ClassNotFoundException: "handlerClassName"

what should I do to make the JVM recognize the class "handlerClassName" in my project?

thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about classpath