The Artima Developer Community
Sponsored Link

Legacy Design Forum
Designing with Dynamic Extension



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Things to try

Posted by Suhayl Masud on March 03, 2000 at 8:13 AM

> I'm trying to load a class using forname with the following code:
> Class c = Class.forName("blah.blah.ClassName");

> where I have a \blah\blah\ClassName.class defined in an extension jar - but I'm getting a ClassNotFound exception - why oh why?


First things to check:

1) If you are using jdk1.2.*, is the .jar in the jre/lib/ext directory? If previous versions are being used: Is it on your classpath?
2) Are you invoking your class as follows:
for jdk1.1.*
jre -classpath x.jar blah.blah.ClassName
for jdk1.2.*
java blah.blah.ClassName
3) Does your jar or Class refer to any classes that are not on the class path? If so, include them all in the class path.

hope this helps.



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us