Re: JAVA_HOME policy
--- Patrick Tullmann <tullmann@cs.utah.edu> wrote:
> > Jetty finds tools.jar itself based on the
> java.home property and
> > adds it to its own classloader. All do some
> checking to see if
> > using the ant.jar directly can do the same thing.
>
> It occurred to me that these tools (ant, jetty,
> etc.) are only
> dependent upon a specific class name (i.e.,
> com.sun.tools.javac.Main),
> and what they really want is whatever jar file
> contains that class.
Programs that use any com.sun.tools.* class are broken
by default anyway. They work by sheer luck and
coincidence.
If you write a program that needs to use a java
compiler, provide a way to specify it. Ant does that
via -Dbuild.compiler=something.
A trivial compiler lookup implementation in my eyes
would be to check a myapp.java.compiler property, and
try to load the class. If that fails, then call it as
a process. That would handle all java based compilers
*and* non-java based ones.
best regards,
dalibor topic
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Reply to: