harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yang Paulex" <paulex.y...@gmail.com>
Subject Re: Have not implemented the method of com.sun.tools.javac.Main.compile([Ljava.lang.String;, java.io.PrintWriter)
Date Thu, 05 Apr 2007 05:03:08 GMT
2007/4/4, Sean Qiu <sean.xx.qiu@gmail.com>:
> When i run tests of openejb with our classlib, it will report
> that it cannot find the method of com.sun.tools.javac.Main.compile([
> Ljava.lang.String;, java.io.PrintWriter).
> In our module of tools, it only implement the
> com.sun.tools.javac.Main.compile([Ljava.lang.String;, java.io.PrintWriter)
> method.

Shall we implement the method? If does, where can we get these internel api
> spec?

Yes, I think we shall, and the implementation can be another simple wrapper
method of ECJ. I found the methods signature in tools Javadoc[1] as below,

public static int compile(String[] args);
public static int compile(String[] args, PrintWriter out);

There is a good match in ECJ entry class
org.eclipse.jdt.internal.compiler.batch.Main's constructor
Main(PrintWriter out, PrintWriter err, Boolean)

[1] <Javadoc root>/docs/tooldocs/solaris/javac.html

>>>>>>. error message >>>>>>>>
> Caused by: java.lang.NoSuchMethodException:
> com.sun.tools.javac.Main.compile
> ([Ljava.lang.String;, java.io.PrintWriter)
>         at java.lang.Class.throwNoSuchMethodException(Class.java:278)
>         at java.lang.Class.getMethod(Class.java:755)
>         at
> org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess
> (JavacCompiler.java:418)
> --
> Sean Qiu

Paulex Yang
China Software Development laboratory

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message