Want to compile a java class within another java class dynamically
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mohan_Kalyanasundaram
Posted On:   Wednesday, April 3, 2002 04:52 PM

I want a facility in my application to give a facility for the user to enter some java code within a java class. I am trying to accept the java code within a text box. After I take the java code input, I would like to compile the class and check for errors all within another java code. How do I do this? Can some one give me a sample code.

Thanks in advance, Mohan

Re: Want to compile a java class within another java class dynamically

Posted By:   Kumaran_N  
Posted On:   Thursday, April 4, 2002 08:01 AM

This could be a tedious approach.


1. Write the Java class into a file with .java


2. Run a Javac process using the java.lang.Runtime.




This is obviously not the best solution, but will work.





Kumaran
About | Sitemap | Contact