I have a project in eclipse, and I've defined the interface and class for dynamic class loading, in the class The project directory, so I have the code in this project:
if (handlerClassName! = Null) {TypeHandler typeHandler = null; Try {typeHandler = (TypeHandler) (Class .forName (handlerClassName) NewestInstance ());
But I get an exception: java.lang.ClassNotFoundException: "handlerClassName"
What should I do to identify JVM class "handlerClassname" in my project ?
Thanks
Use the fully qualified classname, including the entire package, e.g. java.lang.String
instead of a short name like string
. If this is not really in the package, then fix it so that it is in the package. Packaged classes are invisible to classes in the package.
Comments
Post a Comment