Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4164450

JSR 199: Standard interface for Java compilers

XMLWordPrintable

    • b47
    • generic, x86, sparc
    • generic, solaris_2.5.1, solaris_8, windows_95, windows_98, windows_2000, windows_xp
    • Verified

      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

            ahe Peter Ahe
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: