File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Problem in dynamic class creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem in dynamic class creation" Watch "Problem in dynamic class creation" New topic

Problem in dynamic class creation

syruss kumar
Ranch Hand

Joined: Jul 23, 2009
Posts: 100
HI all,

I have tried to create a class dynamically compiled and run that in java 1.5 .I can create a class and compile that but while i try to create a instance for that i got a ClassNotFoundException.Class file should physically located in the file structure?

Please help me to resolve that.

Thanks in advance

All search starts with beginner's luck and all search ends with victor's severly tested.
Ernesto Chicas

Joined: Jan 13, 2010
Posts: 18

seeing your source code, you should save your "dynamic" class in the same directory as the class you've written with the main, probably the class is being saved in the root directory of your project and compiled in the same place
syruss kumar
Ranch Hand

Joined: Jul 23, 2009
Posts: 100
Hi Ernesto,

Thanks for the reply.Yes i can get the DynamicClass.class in the output folder .What im trying is to generate a class dynamically,compile and use that but while i trying to access the MyDynamicClassTest7.class i got the classNotfound Exception.

Please help me out

Thanks in advance
I agree. Here's the link:
subject: Problem in dynamic class creation
It's not a secret anymore!