Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
Name: diC59631 Date: 08/07/98 Several types of Java applications use dynamically generated and compiled code. The most obvious example is a JSP web server. Currently, the only way to compile dynamically generated code is to: 1 - Make a temporary .java file and invoke javac using Runtime.exec. This is rather inelegant and prone to problems related to platform dependent behavior for processes. Its also subject to applet security restrictions. 2 - Hack the internals of javac and use the Java interfaces. It works but its totally undocumented and unsupported. It also doesn't allow you to use a different vendor's compiler. This feature is for a standard interface that is available as a standard extension to Java. That way you have a richer way to access the compiler (if one is available) without forking a new process or relying on undocumented features. You also make it easy for the user to install a different compiler without breaking the tools that rely on it. There are some requirements that the interface should meet: 1 - Be simple to use. 2 - Be stream-based (not file-based). It should accept an InputStream (or Reader) for the source code and generate the class file on an OutputStream. (Review ID: 36593) ====================================================================== ###@###.### 10/26/04 21:05 GMT
|