JDK-4065325 : Why not a class to represent the javac compiler ?
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.1.3
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 1997-07-17
  • Updated: 1997-11-05
  • Resolved: 1997-11-05
Related Reports
Duplicate :  
Description

Name: rlT66838			Date: 07/17/97


Dear sir,

I'm currently involved in dynamic creation of Java classes.
What I do is writing the source code of the dynamically-created class in a file, then calling the javac compiler via the exec method of class Runtime.
This leads to 2 problems :
- I must be able to write somewhere on some hard disk (not even considering packages problems).
- I cannot call the javac compiler in a portable way.

One thing i would be very happy to find is a class that represents the javac compiler.
One of its methods would read the source code in an InputStream object, then return
the bytecode in 1 or several byte[]

To say it abruptly, Java needs more of the features of SmallTalk.
Having a Sheduler class would be fine, too.

Thanks a lot for taking the time to consider this feature request.


======================================================================

Comments
WORK AROUND Name: rlT66838 Date: 07/17/97 ======================================================================
11-06-2004

EVALUATION There are several distinct issues here: 1. security restrictions on being able to access the file system 2. not being able to call JDK tools from within a JVM 3. not having javac functionality part of the standard runtime #1 is dealt with in the new security model of 1.2. #2 is a real concern, and has java/tools bug 4087072 filed against it. #3 will not happen - it would increase the weight of the runtime for not enough gain. I'm closing this as a duplicate of 4087072 although it could just as well have been 'will not fix' or 'integrated'. david.stoutamire@Eng 1997-11-05
05-11-1997