Loading class without qualified name

Is it possible to load a class given only the name of the class,

but not its package information? I also tried googling and forum

search, but either I don't know what kewords to use or there's nothing

out there.

Thanks!

I've tried:

Class.forName("ReflectionClass");

MyClass.class.getClassLoader().getResource("ReflectionClass");

MyClass.class.getClassLoader().getResource("ReflectionClass.class");

MyClass.class.getResource("ReflectionClass");

MyClass.class.getResource("ReflectionClass.class");

Thread.currentThread().getContextClassLoader().getResource("ReflectionClass");

Thread.currentThread().getContextClassLoader().getResource("ReflectionClass.class");

ClassLoader.getSystemResource("ReflectionClass");

ClassLoader.getSystemResource("ReflectionClass.class");

ClassLoader.getSystemClassLoader().loadClass("ReflectionClass").toString();

ClassLoader.getSystemClassLoader().loadClass("ReflectionClass.class").toString();

[1305 byte] By [es5f2000a] at [2007-11-26 20:40:16]
# 1
No. Classes of the same name can be inside different packages. The simple class name does not provide enough information to resolve the class.
_dnoyeBa at 2007-7-10 1:57:55 > top of Java-index,Core,Core APIs...
# 2
Yeah, I was hoping for some ClassLoader magic or somesuch.I figured the odds were slim.Thanks!
es5f2000a at 2007-7-10 1:57:55 > top of Java-index,Core,Core APIs...
# 3
what would that magic be?Invent a package name and hope?If you are interested only in your own classes you could create a classloader which prepends packagenames based on what it knows of your package structure, but that's grasping at straws.
jwentinga at 2007-7-10 1:57:55 > top of Java-index,Core,Core APIs...
# 4
Well if its 'magic' it does not require any logic :)
_dnoyeBa at 2007-7-10 1:57:55 > top of Java-index,Core,Core APIs...
# 5
any technology sufficiently advanced will seem like magic to those who don't understand it.I think it was Heinlein who said that, but many others had similar thoughts.Logic to those who don't posess it would also seem like magic.
jwentinga at 2007-7-10 1:57:55 > top of Java-index,Core,Core APIs...