JP.ac.tsukuba.openjava
Class SunJavaCompiler

java.lang.Object
  |
  +--JP.ac.tsukuba.openjava.SunJavaCompiler
All Implemented Interfaces:
JavaCompiler

public class SunJavaCompiler
extends Object
implements JavaCompiler

The class SunJavaCompiler is an adapter for Sun's javac. Message-Id: 19990930154627G.shiro@squareusa.com

I tried OpenJava1.0a1 on my IRIX box w/ SGI's JDK1.2 and had a problem to run ojc. Somehow, Runtime.exec() didn't pass all the environment variables to the invoked process (more specifically, it only passed TZ). Consequently the CLASSPATH env was not passed to javac kicked by JP.ac.tsukuba.openjava.SunJavaCompiler.complie(), which prevented ojc from finishing compilation.

So far I couldn't find exact specification about how the environment variables should be treated in Java specification and API documents. I guess it may depend on platforms.

We avoided the problem by explicitly passing CLASSPATH to the subprocess my modifying SunJavaCompiler class, but wondering if there'd be a better way to handle it...


Nested Class Summary
private  class SunJavaCompiler.CompilationFailedException
           
(package private) static class SunJavaCompiler.Sucker
          A Sucker collects the output from a reader in a string buffer.
 
Field Summary
(package private)  JavaCompilerArgs args
           
private static Object compilerMutex
           
 
Constructor Summary
SunJavaCompiler()
           
 
Method Summary
 void compile()
           
protected  void compile(String[] args)
           
private  void compileExternal(String[] args)
           
 JavaCompilerArgs getArgs()
           
 ClassLoader getClassLoader()
           
static void main(String[] args)
           
private static String toString(String[] strs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

args

JavaCompilerArgs args

compilerMutex

private static Object compilerMutex
Constructor Detail

SunJavaCompiler

public SunJavaCompiler()
Method Detail

main

public static void main(String[] args)

compile

public void compile()
Specified by:
compile in interface JavaCompiler

getArgs

public JavaCompilerArgs getArgs()
Specified by:
getArgs in interface JavaCompiler

getClassLoader

public ClassLoader getClassLoader()
Specified by:
getClassLoader in interface JavaCompiler

compileExternal

private void compileExternal(String[] args)

compile

protected void compile(String[] args)

toString

private static String toString(String[] strs)

SourceForge.net_Logo