You must explicitly load the class file you newly
defined and create an instance of that by the
reflection API (java.lang.reflect).
The latest version of Javassist, which you can
download from CVS HEAD, provides a very
convenient method toClass() for doing that.
I still have a problem understanding the answer. Say for instance I create a new class with javassist named myClass and build into it three variables called x1 x2 and x3.
Now the answer on how to create an instance if myClass seems easy, but how do I avoid compiler erros on my main prorgam when attempting to access x1, x2 and x3?
No, you cannot avoid compiler errors if you
directly access such fields as x1, x2, and x3.
Instead, you must use the Java reflection API
for accessing those fields.