[#2797] - JSR 199: Compiler API

Category:
Feature request
Priority:
Normal
Status:
Acknowledged
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

The short version: The Java 6 compiler API adds flexibility for those compiling in various environments, such as applets with custom class loaders.

The long version:

For me, it would likely help my situation, I am currently creating and compiling JasperDesign objects on the fly with the JDT compiler. This works great. The problem is it's in an applet and our framework is supposed to use a custom classloader, which doesn't play nice with JDT. For now the Jasper stuff is running in a separate applet with a plain vanilla classloader.

Trying to deploy the javac compiler didn't work for a number of reasons. Maybe this means the Compiler API wouldn't work either, I don't know.

lucianc commented:
This would be interesting. However, at my first (quick) look at JSR 199, I didn't see how would a Java compiler use a classloader to resolve classes during compilation. We'll have to investigate this further.

my reply:
It looks like when compiling with this API you might be able to provide your own implementation of of the JavaFileManager. Just a brief look at it, but that looks like it manages the interaction with the ClassLoader.

culli's picture
4
Joined: Sep 10 2007 - 1:25pm
Last seen: 14 years 11 months ago
Feedback
randomness