Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jp.ac.tsukuba.openjava
Class SunJavaCompiler  view SunJavaCompiler download SunJavaCompiler.java

java.lang.Object
  extended byjp.ac.tsukuba.openjava.SunJavaCompiler
All Implemented Interfaces:
openjava.ojc.JavaCompiler

public class SunJavaCompiler
extends java.lang.Object
implements openjava.ojc.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...


Constructor Summary
SunJavaCompiler()
           
 
Method Summary
 void compile(java.lang.String[] args)
           
static void main(java.lang.String[] args)
           
private static java.lang.String strs2str(java.lang.String[] strs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SunJavaCompiler

public SunJavaCompiler()
Method Detail

main

public static void main(java.lang.String[] args)

compile

public void compile(java.lang.String[] args)
Specified by:
compile in interface openjava.ojc.JavaCompiler

strs2str

private static java.lang.String strs2str(java.lang.String[] strs)