File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes class loader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class loader" Watch "class loader" New topic
Author

class loader

yogi ta dev
Greenhorn

Joined: Nov 25, 2004
Posts: 9
Hi ,
I have to load .class files .Can anyone pls let me know how to do it?
I have tried searching ,but could not find.
Thanks,
yogita
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

Hi,

Welcome to JavaRanch!

Depends what you want to do, exactly. If you're just loading them from normal .class files, The static method forName() in the java.lang.Class class will do it for you. If you're doing something fancier, you may need to write your own ClassLoader, or at least explicitly use one of the standard ones. Let us know what you need to do.


[Jess in Action][AskingGoodQuestions]
yogi ta dev
Greenhorn

Joined: Nov 25, 2004
Posts: 9
I have an array which has all class files names.I have to check if they exist in classes directory and load them,then use refection to get methods
in each of the classes.

Thanks,
yogita
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
yogi dev, Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

Thanks Pardner! Hope to see you 'round the Ranch!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
I'm moving this to the Intermediate forum...
[ November 27, 2004: Message edited by: Dirk Schreckmann ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class loader