How to reload a .java file having inner classes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to reload a .java file having inner classes

Jesper Jonasson

Hi,

 

I have tried to reload .java files in the BeanShell interpreter using the ”source” command. Reloading .java files without inner classes works fine, but it is not possible to reload files containing inner classes. The error message I get is as follows:

 

Target exception: Sourced file: F:/jjo/BeanShell/Example3.java internal Error: Defining class problem: Example3$Test: BeanShell cannot yet simultaneously define two or more dependant classes of the same name.  Attempt to define: Example3$Test while defining: Example3$Test : at Line: 11 : in file: F:/jjo/BeanShell/Example3.java :

 

I find the reloading capability very powerful, but I’d also like to be able to load .java files containing inner classes.

 

My question is if there is a workaround for this?

 

Jesper Jonasson