You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Sean Qiu <se...@gmail.com> on 2007/04/04 12:36:55 UTC

Have not implemented the method of com.sun.tools.javac.Main.compile([Ljava.lang.String;, java.io.PrintWriter)

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?

>>>>>>. 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

Re: Have not implemented the method of com.sun.tools.javac.Main.compile([Ljava.lang.String;, java.io.PrintWriter)

Posted by Mikhail Loenko <ml...@gmail.com>.
2007/4/5, Mikhail Loenko <ml...@gmail.com>:
> 2007/4/4, Sean Qiu <se...@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)
>
> you've probably meant
> com.sun.tools.javac.Main.compile([Ljava.lang.String;)
>
>
> > method.
> >
> > Shall we implement the method?
>
> Yes
>
>
> If does, where can we get these internel api
> > spec?
>
> Is it possible to understand it from openejb tests?

I've looked at our Compiler.java, it creates eclipse compiler with two Writer
args (outWriter and errWriter).
I think that if we replace either err or both of them by the
PrintWriter we get as an input, we will obtain desired behavior.

Thanks,
Mikhail

>
> Thanks,
> Mikhail
>
> P.S. why do we have com.sun.* in the tools rather than in the suncompat module?
>
>
>
> >
> > >>>>>>. 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
> >
>

Re: Have not implemented the method of com.sun.tools.javac.Main.compile([Ljava.lang.String;, java.io.PrintWriter)

Posted by Sean Qiu <se...@gmail.com>.
We will merge the classlib/trunk/modules/tools into
jdktools/trunk/modules/tools sooner  or later. There will be no former
module in the future. Am i right?

So i will implemented this method to jdktools rather than classlib tools.

2007/4/5, Ivan Popov <iv...@gmail.com>:
> Please note that there are two copies of tools module (including javac
> sources). One in classlib and another in jdktools. It was decided to
> remove classlib's copy after tools sources were copied to jdktools
> [1], but nobody did that. Now sources in these copies are slightly
> different.
>
> It makes sense first to merge changes in both copies and get rid of
> classlib's one and then continue modification of javac sources in
> jdktools.
>
> Thanks.
> Ivan
>
> [1] http://thread.gmane.org/gmane.comp.java.harmony.devel/22502
>
> On 4/5/07, Sean Qiu <se...@gmail.com> wrote:
> > 2007/4/5, Mikhail Loenko <ml...@gmail.com>:
> > > 2007/4/4, Sean Qiu <se...@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)
> > >
> >
> > Sorry for being careless
> > Yes, you are right . Thanks  :)
> >
> > > you've probably meant
> > > com.sun.tools.javac.Main.compile([Ljava.lang.String;)
> > >
> > >
> > > > method.
> > > >
> > > > Shall we implement the method?
> > >
> > > Yes
> > >
> > >
> > > If does, where can we get these internel api
> > > > spec?
> > >
> >
> > I will try.
> >
> > > Is it possible to understand it from openejb tests?
> > >
> > > Thanks,
> > > Mikhail
> > >
> > > P.S. why do we have com.sun.* in the tools rather than in the suncompat module?
> > >
> > >
> > >
> > > >
> > > > >>>>>>. 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
> > > >
> > >
> >
> >
> >
> > --
> > Sean Qiu
> >
>


-- 
Sean Qiu

Re: Have not implemented the method of com.sun.tools.javac.Main.compile([Ljava.lang.String;, java.io.PrintWriter)

Posted by Ivan Popov <iv...@gmail.com>.
Please note that there are two copies of tools module (including javac
sources). One in classlib and another in jdktools. It was decided to
remove classlib's copy after tools sources were copied to jdktools
[1], but nobody did that. Now sources in these copies are slightly
different.

It makes sense first to merge changes in both copies and get rid of
classlib's one and then continue modification of javac sources in
jdktools.

Thanks.
Ivan

[1] http://thread.gmane.org/gmane.comp.java.harmony.devel/22502

On 4/5/07, Sean Qiu <se...@gmail.com> wrote:
> 2007/4/5, Mikhail Loenko <ml...@gmail.com>:
> > 2007/4/4, Sean Qiu <se...@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)
> >
>
> Sorry for being careless
> Yes, you are right . Thanks  :)
>
> > you've probably meant
> > com.sun.tools.javac.Main.compile([Ljava.lang.String;)
> >
> >
> > > method.
> > >
> > > Shall we implement the method?
> >
> > Yes
> >
> >
> > If does, where can we get these internel api
> > > spec?
> >
>
> I will try.
>
> > Is it possible to understand it from openejb tests?
> >
> > Thanks,
> > Mikhail
> >
> > P.S. why do we have com.sun.* in the tools rather than in the suncompat module?
> >
> >
> >
> > >
> > > >>>>>>. 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
> > >
> >
>
>
>
> --
> Sean Qiu
>

Re: Have not implemented the method of com.sun.tools.javac.Main.compile([Ljava.lang.String;, java.io.PrintWriter)

Posted by Sean Qiu <se...@gmail.com>.
2007/4/5, Mikhail Loenko <ml...@gmail.com>:
> 2007/4/4, Sean Qiu <se...@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)
>

Sorry for being careless
Yes, you are right . Thanks  :)

> you've probably meant
> com.sun.tools.javac.Main.compile([Ljava.lang.String;)
>
>
> > method.
> >
> > Shall we implement the method?
>
> Yes
>
>
> If does, where can we get these internel api
> > spec?
>

I will try.

> Is it possible to understand it from openejb tests?
>
> Thanks,
> Mikhail
>
> P.S. why do we have com.sun.* in the tools rather than in the suncompat module?
>
>
>
> >
> > >>>>>>. 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
> >
>



-- 
Sean Qiu

Re: Have not implemented the method of com.sun.tools.javac.Main.compile([Ljava.lang.String;, java.io.PrintWriter)

Posted by Mikhail Loenko <ml...@gmail.com>.
2007/4/4, Sean Qiu <se...@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)

you've probably meant
com.sun.tools.javac.Main.compile([Ljava.lang.String;)


> method.
>
> Shall we implement the method?

Yes


If does, where can we get these internel api
> spec?

Is it possible to understand it from openejb tests?

Thanks,
Mikhail

P.S. why do we have com.sun.* in the tools rather than in the suncompat module?



>
> >>>>>>. 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
>

Re: Have not implemented the method of com.sun.tools.javac.Main.compile([Ljava.lang.String;, java.io.PrintWriter)

Posted by Sean Qiu <se...@gmail.com>.
Thanks, i will supply a patch to Jira later.

2007/4/5, Yang Paulex <pa...@gmail.com>:
>
> 2007/4/4, Sean Qiu <se...@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
> IBM
>



-- 
Sean Qiu

Re: Have not implemented the method of com.sun.tools.javac.Main.compile([Ljava.lang.String;, java.io.PrintWriter)

Posted by Yang Paulex <pa...@gmail.com>.
2007/4/4, Sean Qiu <se...@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
IBM