Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I convert a string to an object or class

skidmarksMar 28 2011 — edited Mar 28 2011
I would like to read a file representing a class, and convert it to an object or a class (object preferred). Other postings suggest using javax.tools.JavaCompiler to convert from a string but then say that this is not always available (posting on 1 Jan 09). If this is still not universally available is there another way to do this? If this is not available, are there any examples of how it should be done?

My understanding from what I've read is to read the file into a String then compile the String using javax.tools.JavaCompiler, which is an Interface.

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 25 2011
Added on Mar 28 2011
16 comments
736 views