You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Jordan Justen <jl...@gmail.com> on 2006/08/28 01:53:53 UTC

[app] ant with ecj

Hi all.

I'm trying to use ant with the ecj compiler.  I override the compiler in
build.xml like this:
  <property name="build.compiler" value="
org.eclipse.jdt.core.JDTCompilerAdapter" />

This will execute the compiler, but I find I have to add each jar from
jdk/jre/lib/boot to CLASSPATH or else ecj won't find the standard classes
during compilation.

This is probably user error, and not related to harmony. :)  Does anyone
know what I might be improperly configuring?

Thanks,

-Jordan

RE: [app] ant with ecj

Posted by Nathan Beyer <nb...@kc.rr.com>.

> -----Original Message-----
> From: Alexey Petrenko [mailto:alexey.a.petrenko@gmail.com]
> Sent: Monday, August 28, 2006 1:25 AM
> To: harmony-dev@incubator.apache.org
> Subject: Re: [app] ant with ecj
> 
> 2006/8/28, Vladimir Gorr <vv...@gmail.com>:
> > Indeed this issue exists if JAVA_HOME refers to Harmony JRE:
> > echo $JAVA_HOME
> > .../classlib/trunk/deploy/jdk/jre
> >
> > echo $LD_LIBRARY_PATH
> > .../classlib/trunk/deploy/jdk/jre/bin
> >
> > echo $CLASSPATH=.../classlib/trunk/depends/jars/ecj_3.2/ecj_3.2.jar
> >
> > ant -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter
> >
> > ...
> > [javac] 3608. ERROR in
> >
> /nfs/ins/proj/drl/coreapi/vgorr/GIT/classlib/trunk/modules/text/src/main/j
> ava/java/text/DecimalFormat.java
> >    [javac]  (at line 23)
> >    [javac]     import java.math.BigDecimal;
> > ...
> >
> > It means our build system doesn't work correspondingly for the self-
> hosting
> > mode.
> Strange... It worked some time ago.
> 
> > Besides I'd like to note a lot of warning are generated when we use
> ECJ3.2.
> Yep, that is known issue.
> Eclipse compiler is much more worried then RI's :)

I believe we could get many of the same errors if we enabled -Xlint with the
RI.

> 
> >
> > Thanks,
> > Vladimir.
> >
> >
> >
> >
> > On 8/28/06, Jordan Justen <jl...@gmail.com> wrote:
> > >
> > > My JAVA_HOME is set to harmony/jdk/jre.
> > >
> > > Are you sure ant is running with harmony's jvm and classlibs when
> > > JAVA_HOME
> > > is set to sun's path?
> > >
> > > I am wanting to use the harmony classlibs and jvm with ant and the ecj
> > > compiler.  Hopefully this would make no dependencies on sun's java.
> > >
> > > You know what.  I didn't explicitly mention that I was trying to run
> this
> > > with harmony.  Whoops, sorry.
> > >
> > > -Jordan
> > >
> > > On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
> > > >
> > > > The current build scripts should be doing this already. For example,
> > > this
> > > > is
> > > > a snippet from the 'luni' module's build script.
> > > >
> > > >         <javac sourcepath=""
> > > >                srcdir="${hy.luni.src.main.java}"
> > > >                destdir="${hy.build}"
> > > >                source="${hy.javac.source}"
> > > >                target="${hy.javac.target}"
> > > >                debug="${hy.javac.debug}">
> > > >             <bootclasspath>
> > > >                 <fileset dir="${hy.jdk}/jre/lib/boot">
> > > >                     <include name="**/*.jar" />
> > > >                 </fileset>
> > > >             </bootclasspath>
> > > >         </javac>
> > > >
> > > > It points to luni's source directory and puts everything in the
> deploy
> > > > (JDK)/jre/lib/boot folder on the bootclasspath to compile against.
> In
> > > the
> > > > case of "java.lang.Object", this should be in the "luni-kernel-
> stubs.jar
> > > ".
> > > > If you're doing a full compile, then "java.lang.Object" should be
> > > included
> > > > in the source files.
> > > >
> > > > I just ran the build using the Eclipse compiler and it worked fine.
> > > Here's
> > > > what I did.
> > > > 1. Check out all of the code from the classlib trunk [1] down. You
> need
> > > > everything from the folder down.
> > > > 2. From the 'trunk' folder, run 'ant fetch-depends', which downloads
> all
> > > > of
> > > > the dependencies for the build.
> > > > 3. Grab the ecj_3.2.jar from the 'trunk/depends/jars/ecj_3.2' and
> copied
> > > > it
> > > > into my ANT_HOME/lib folder. This puts ECJ on Ant's classpath.
> > > > 4. From the 'trunk' folder, run 'ant build
> > > > -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter' and the
> entire
> > > > federated build runs.
> > > >
> > > > Is this similar to what you're doing? Note, I'm running Ant with
> > > JAVA_HOME
> > > > pointing to Sun's 5.0_7 JDK.
> > > >
> > > > -Nathan
> > > >
> > > > [1]
> > > >
> > > >
> > >
> https://svn.apache.org/repos/asf/incubator/harmony/enhanced/classlib/trunk
> /
> > > >
> > > > > -----Original Message-----
> > > > > From: Jordan Justen [mailto:jljusten@gmail.com]
> > > > > Sent: Sunday, August 27, 2006 10:31 PM
> > > > > To: harmony-dev@incubator.apache.org
> > > > > Subject: Re: [app] ant with ecj
> > > > >
> > > > > Nathan,
> > > > >
> > > > > Is there a way to have the javac/ecj task include all of standard
> > > > harmony
> > > > > jars without including them in the CLASSPATH environment variable?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > -Jordan
> > > > >
> > > > > On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
> > > > > >
> > > > > > Keep in mind that the execution of the Ant scripts and the
> > > compilation
> > > > > are
> > > > > > two separate things, which means they are using two different
> > > > > classpaths.
> > > > > > If
> > > > > > the compilation task is complaining about a missing class, then
> this
> > > > > means
> > > > > > the class is missing from the classpath of the compiler, not the
> > > > > classpath
> > > > > > of the executing Ant. You'll need the Eclipse compiler JAR on
> Ant's
> > > > > > execution classpath to execute the javac task.
> > > > > >
> > > > > > This can be confusing when using the Eclipse compiler, since it
> > > > doesn't
> > > > > > have
> > > > > > any "default" classpath. Normally when you're using 'javac' from
> a
> > > > JDK,
> > > > > > the
> > > > > > classpath of the underlying JRE (all of the java.*, etc classes)
> is
> > > > > > automatically on the classpath. The Eclipse compiler is not part
> of
> > > a
> > > > > JDK,
> > > > > > so there is nothing on the classpath by default.
> > > > > >
> > > > > > -Nathan
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Jordan Justen [mailto:jljusten@gmail.com]
> > > > > > > Sent: Sunday, August 27, 2006 8:49 PM
> > > > > > > To: harmony-dev@incubator.apache.org
> > > > > > > Subject: Re: [app] ant with ecj
> > > > > > >
> > > > > > > Richard,
> > > > > > >
> > > > > > > Yes, I also added ecj_3.2.jar to the CLASSPATH.
> > > > > > >
> > > > > > > Ant works fine, but the first time a javac task is
> encountered,
> > > the
> > > > > > > compiler
> > > > > > > complained that java.lang.Object was not found.  I then added
> > > > > > > jdk/jre/lib/boot/kernel.jar to CLASSPATH.  Now, I see an error
> > > that
> > > > > > > java.lang.String is not found, so I added luni.jar to
> CLASSPATH.
> > > > > etc...
> > > > > > >
> > > > > > > Since ant is basically working (mkdir tasks, delete tasks,
> java
> > > > tasks
> > > > > > all
> > > > > > > seem to work), I think the harmony jvm is loading these "boot"
> > > jars,
> > > > > but
> > > > > > > it
> > > > > > > seems like when the javac task uses ecj, those jars are not
> > > visible.
> > > > > > >
> > > > > > > I'm using windows xp, ant 1.6.5, and the latest harmony jdk
> > > > snapshot.
> > > > > > >
> > > > > > > Thanks again,
> > > > > > >
> > > > > > > -Jordan
> > > > > > >
> > > > > > > On 8/27/06, Richard Liang <ri...@gmail.com> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Jordan Justen wrote:
> > > > > > > > > Hi all.
> > > > > > > > >
> > > > > > > > > I'm trying to use ant with the ecj compiler.  I override
> the
> > > > > > compiler
> > > > > > > in
> > > > > > > > > build.xml like this:
> > > > > > > > >  <property name="build.compiler" value="
> > > > > > > > > org.eclipse.jdt.core.JDTCompilerAdapter" />
> > > > > > > > >
> > > > > > > > > This will execute the compiler, but I find I have to add
> each
> > > > jar
> > > > > > from
> > > > > > > > > jdk/jre/lib/boot to CLASSPATH or else ecj won't find the
> > > > standard
> > > > > > > > classes
> > > > > > > > > during compilation.
> > > > > > > > >
> > > > > > > > > This is probably user error, and not related to harmony.
> > > > :)  Does
> > > > > > > anyone
> > > > > > > > > know what I might be improperly configuring?
> > > > > > > > Hello Jordan,
> > > > > > > >
> > > > > > > > Do you mean the "build.compiler" property in
> > > make/build_java.xml?
> > > > I
> > > > > > just
> > > > > > > > give it a try by 1) overriding the compiler as what you have
> > > done
> > > > 2)
> > > > > > > > adding
> > > C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar
> > > > > > into
> > > > > > > > classpath.
> > > > > > > >
> > > > > > > > Everything works OK. :-) Could you give more detailed
> > > information
> > > > > > about
> > > > > > > > this issue? Thanks a lot.
> > > > > > > >
> > > > > > > > Best regards,
> > > > > > > > Richard
> > > > > > > > >
> > > > > > > > > Thanks,
> > > > > > > > >
> > > > > > > > > -Jordan
> > > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Richard Liang
> > > > > > > > China Software Development Lab, IBM
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > --------------------------------------------------------------------
> > > > > -
> > > > > > > > Terms of use :
> http://incubator.apache.org/harmony/mailing.html
> > > > > > > > To unsubscribe, e-mail:
> > > > harmony-dev-unsubscribe@incubator.apache.org
> > > > > > > > For additional commands, e-mail: harmony-dev-
> > > > > help@incubator.apache.org
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > > > To unsubscribe, e-mail: harmony-dev-
> unsubscribe@incubator.apache.org
> > > > > > For additional commands, e-mail:
> > > harmony-dev-help@incubator.apache.org
> > > > > >
> > > > > >
> > > >
> > > >
> > > > --------------------------------------------------------------------
> -
> > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > > For additional commands, e-mail: harmony-dev-
> help@incubator.apache.org
> > > >
> > > >
> > >
> > >
> >
> >
> 
> 
> --
> Alexey A. Petrenko
> Intel Middleware Products Division
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [app] ant with ecj

Posted by Alexey Petrenko <al...@gmail.com>.
2006/8/28, Vladimir Gorr <vv...@gmail.com>:
> Indeed this issue exists if JAVA_HOME refers to Harmony JRE:
> echo $JAVA_HOME
> .../classlib/trunk/deploy/jdk/jre
>
> echo $LD_LIBRARY_PATH
> .../classlib/trunk/deploy/jdk/jre/bin
>
> echo $CLASSPATH=.../classlib/trunk/depends/jars/ecj_3.2/ecj_3.2.jar
>
> ant -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter
>
> ...
> [javac] 3608. ERROR in
> /nfs/ins/proj/drl/coreapi/vgorr/GIT/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormat.java
>    [javac]  (at line 23)
>    [javac]     import java.math.BigDecimal;
> ...
>
> It means our build system doesn't work correspondingly for the self-hosting
> mode.
Strange... It worked some time ago.

> Besides I'd like to note a lot of warning are generated when we use ECJ3.2.
Yep, that is known issue.
Eclipse compiler is much more worried then RI's :)

>
> Thanks,
> Vladimir.
>
>
>
>
> On 8/28/06, Jordan Justen <jl...@gmail.com> wrote:
> >
> > My JAVA_HOME is set to harmony/jdk/jre.
> >
> > Are you sure ant is running with harmony's jvm and classlibs when
> > JAVA_HOME
> > is set to sun's path?
> >
> > I am wanting to use the harmony classlibs and jvm with ant and the ecj
> > compiler.  Hopefully this would make no dependencies on sun's java.
> >
> > You know what.  I didn't explicitly mention that I was trying to run this
> > with harmony.  Whoops, sorry.
> >
> > -Jordan
> >
> > On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
> > >
> > > The current build scripts should be doing this already. For example,
> > this
> > > is
> > > a snippet from the 'luni' module's build script.
> > >
> > >         <javac sourcepath=""
> > >                srcdir="${hy.luni.src.main.java}"
> > >                destdir="${hy.build}"
> > >                source="${hy.javac.source}"
> > >                target="${hy.javac.target}"
> > >                debug="${hy.javac.debug}">
> > >             <bootclasspath>
> > >                 <fileset dir="${hy.jdk}/jre/lib/boot">
> > >                     <include name="**/*.jar" />
> > >                 </fileset>
> > >             </bootclasspath>
> > >         </javac>
> > >
> > > It points to luni's source directory and puts everything in the deploy
> > > (JDK)/jre/lib/boot folder on the bootclasspath to compile against. In
> > the
> > > case of "java.lang.Object", this should be in the "luni-kernel-stubs.jar
> > ".
> > > If you're doing a full compile, then "java.lang.Object" should be
> > included
> > > in the source files.
> > >
> > > I just ran the build using the Eclipse compiler and it worked fine.
> > Here's
> > > what I did.
> > > 1. Check out all of the code from the classlib trunk [1] down. You need
> > > everything from the folder down.
> > > 2. From the 'trunk' folder, run 'ant fetch-depends', which downloads all
> > > of
> > > the dependencies for the build.
> > > 3. Grab the ecj_3.2.jar from the 'trunk/depends/jars/ecj_3.2' and copied
> > > it
> > > into my ANT_HOME/lib folder. This puts ECJ on Ant's classpath.
> > > 4. From the 'trunk' folder, run 'ant build
> > > -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter' and the entire
> > > federated build runs.
> > >
> > > Is this similar to what you're doing? Note, I'm running Ant with
> > JAVA_HOME
> > > pointing to Sun's 5.0_7 JDK.
> > >
> > > -Nathan
> > >
> > > [1]
> > >
> > >
> > https://svn.apache.org/repos/asf/incubator/harmony/enhanced/classlib/trunk/
> > >
> > > > -----Original Message-----
> > > > From: Jordan Justen [mailto:jljusten@gmail.com]
> > > > Sent: Sunday, August 27, 2006 10:31 PM
> > > > To: harmony-dev@incubator.apache.org
> > > > Subject: Re: [app] ant with ecj
> > > >
> > > > Nathan,
> > > >
> > > > Is there a way to have the javac/ecj task include all of standard
> > > harmony
> > > > jars without including them in the CLASSPATH environment variable?
> > > >
> > > > Thanks,
> > > >
> > > > -Jordan
> > > >
> > > > On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
> > > > >
> > > > > Keep in mind that the execution of the Ant scripts and the
> > compilation
> > > > are
> > > > > two separate things, which means they are using two different
> > > > classpaths.
> > > > > If
> > > > > the compilation task is complaining about a missing class, then this
> > > > means
> > > > > the class is missing from the classpath of the compiler, not the
> > > > classpath
> > > > > of the executing Ant. You'll need the Eclipse compiler JAR on Ant's
> > > > > execution classpath to execute the javac task.
> > > > >
> > > > > This can be confusing when using the Eclipse compiler, since it
> > > doesn't
> > > > > have
> > > > > any "default" classpath. Normally when you're using 'javac' from a
> > > JDK,
> > > > > the
> > > > > classpath of the underlying JRE (all of the java.*, etc classes) is
> > > > > automatically on the classpath. The Eclipse compiler is not part of
> > a
> > > > JDK,
> > > > > so there is nothing on the classpath by default.
> > > > >
> > > > > -Nathan
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Jordan Justen [mailto:jljusten@gmail.com]
> > > > > > Sent: Sunday, August 27, 2006 8:49 PM
> > > > > > To: harmony-dev@incubator.apache.org
> > > > > > Subject: Re: [app] ant with ecj
> > > > > >
> > > > > > Richard,
> > > > > >
> > > > > > Yes, I also added ecj_3.2.jar to the CLASSPATH.
> > > > > >
> > > > > > Ant works fine, but the first time a javac task is encountered,
> > the
> > > > > > compiler
> > > > > > complained that java.lang.Object was not found.  I then added
> > > > > > jdk/jre/lib/boot/kernel.jar to CLASSPATH.  Now, I see an error
> > that
> > > > > > java.lang.String is not found, so I added luni.jar to CLASSPATH.
> > > > etc...
> > > > > >
> > > > > > Since ant is basically working (mkdir tasks, delete tasks, java
> > > tasks
> > > > > all
> > > > > > seem to work), I think the harmony jvm is loading these "boot"
> > jars,
> > > > but
> > > > > > it
> > > > > > seems like when the javac task uses ecj, those jars are not
> > visible.
> > > > > >
> > > > > > I'm using windows xp, ant 1.6.5, and the latest harmony jdk
> > > snapshot.
> > > > > >
> > > > > > Thanks again,
> > > > > >
> > > > > > -Jordan
> > > > > >
> > > > > > On 8/27/06, Richard Liang <ri...@gmail.com> wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Jordan Justen wrote:
> > > > > > > > Hi all.
> > > > > > > >
> > > > > > > > I'm trying to use ant with the ecj compiler.  I override the
> > > > > compiler
> > > > > > in
> > > > > > > > build.xml like this:
> > > > > > > >  <property name="build.compiler" value="
> > > > > > > > org.eclipse.jdt.core.JDTCompilerAdapter" />
> > > > > > > >
> > > > > > > > This will execute the compiler, but I find I have to add each
> > > jar
> > > > > from
> > > > > > > > jdk/jre/lib/boot to CLASSPATH or else ecj won't find the
> > > standard
> > > > > > > classes
> > > > > > > > during compilation.
> > > > > > > >
> > > > > > > > This is probably user error, and not related to harmony.
> > > :)  Does
> > > > > > anyone
> > > > > > > > know what I might be improperly configuring?
> > > > > > > Hello Jordan,
> > > > > > >
> > > > > > > Do you mean the "build.compiler" property in
> > make/build_java.xml?
> > > I
> > > > > just
> > > > > > > give it a try by 1) overriding the compiler as what you have
> > done
> > > 2)
> > > > > > > adding
> > C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar
> > > > > into
> > > > > > > classpath.
> > > > > > >
> > > > > > > Everything works OK. :-) Could you give more detailed
> > information
> > > > > about
> > > > > > > this issue? Thanks a lot.
> > > > > > >
> > > > > > > Best regards,
> > > > > > > Richard
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > -Jordan
> > > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Richard Liang
> > > > > > > China Software Development Lab, IBM
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > --------------------------------------------------------------------
> > > > -
> > > > > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > > > > To unsubscribe, e-mail:
> > > harmony-dev-unsubscribe@incubator.apache.org
> > > > > > > For additional commands, e-mail: harmony-dev-
> > > > help@incubator.apache.org
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > > > For additional commands, e-mail:
> > harmony-dev-help@incubator.apache.org
> > > > >
> > > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> > >
> > >
> >
> >
>
>


-- 
Alexey A. Petrenko
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [app] ant with ecj

Posted by Vladimir Gorr <vv...@gmail.com>.
Indeed this issue exists if JAVA_HOME refers to Harmony JRE:
echo $JAVA_HOME
.../classlib/trunk/deploy/jdk/jre

echo $LD_LIBRARY_PATH
.../classlib/trunk/deploy/jdk/jre/bin

echo $CLASSPATH=.../classlib/trunk/depends/jars/ecj_3.2/ecj_3.2.jar

ant -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter

...
[javac] 3608. ERROR in
/nfs/ins/proj/drl/coreapi/vgorr/GIT/classlib/trunk/modules/text/src/main/java/java/text/DecimalFormat.java
    [javac]  (at line 23)
    [javac]     import java.math.BigDecimal;
...

It means our build system doesn't work correspondingly for the self-hosting
mode.
Besides I'd like to note a lot of warning are generated when we use ECJ3.2.

Thanks,
Vladimir.




On 8/28/06, Jordan Justen <jl...@gmail.com> wrote:
>
> My JAVA_HOME is set to harmony/jdk/jre.
>
> Are you sure ant is running with harmony's jvm and classlibs when
> JAVA_HOME
> is set to sun's path?
>
> I am wanting to use the harmony classlibs and jvm with ant and the ecj
> compiler.  Hopefully this would make no dependencies on sun's java.
>
> You know what.  I didn't explicitly mention that I was trying to run this
> with harmony.  Whoops, sorry.
>
> -Jordan
>
> On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
> >
> > The current build scripts should be doing this already. For example,
> this
> > is
> > a snippet from the 'luni' module's build script.
> >
> >         <javac sourcepath=""
> >                srcdir="${hy.luni.src.main.java}"
> >                destdir="${hy.build}"
> >                source="${hy.javac.source}"
> >                target="${hy.javac.target}"
> >                debug="${hy.javac.debug}">
> >             <bootclasspath>
> >                 <fileset dir="${hy.jdk}/jre/lib/boot">
> >                     <include name="**/*.jar" />
> >                 </fileset>
> >             </bootclasspath>
> >         </javac>
> >
> > It points to luni's source directory and puts everything in the deploy
> > (JDK)/jre/lib/boot folder on the bootclasspath to compile against. In
> the
> > case of "java.lang.Object", this should be in the "luni-kernel-stubs.jar
> ".
> > If you're doing a full compile, then "java.lang.Object" should be
> included
> > in the source files.
> >
> > I just ran the build using the Eclipse compiler and it worked fine.
> Here's
> > what I did.
> > 1. Check out all of the code from the classlib trunk [1] down. You need
> > everything from the folder down.
> > 2. From the 'trunk' folder, run 'ant fetch-depends', which downloads all
> > of
> > the dependencies for the build.
> > 3. Grab the ecj_3.2.jar from the 'trunk/depends/jars/ecj_3.2' and copied
> > it
> > into my ANT_HOME/lib folder. This puts ECJ on Ant's classpath.
> > 4. From the 'trunk' folder, run 'ant build
> > -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter' and the entire
> > federated build runs.
> >
> > Is this similar to what you're doing? Note, I'm running Ant with
> JAVA_HOME
> > pointing to Sun's 5.0_7 JDK.
> >
> > -Nathan
> >
> > [1]
> >
> >
> https://svn.apache.org/repos/asf/incubator/harmony/enhanced/classlib/trunk/
> >
> > > -----Original Message-----
> > > From: Jordan Justen [mailto:jljusten@gmail.com]
> > > Sent: Sunday, August 27, 2006 10:31 PM
> > > To: harmony-dev@incubator.apache.org
> > > Subject: Re: [app] ant with ecj
> > >
> > > Nathan,
> > >
> > > Is there a way to have the javac/ecj task include all of standard
> > harmony
> > > jars without including them in the CLASSPATH environment variable?
> > >
> > > Thanks,
> > >
> > > -Jordan
> > >
> > > On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
> > > >
> > > > Keep in mind that the execution of the Ant scripts and the
> compilation
> > > are
> > > > two separate things, which means they are using two different
> > > classpaths.
> > > > If
> > > > the compilation task is complaining about a missing class, then this
> > > means
> > > > the class is missing from the classpath of the compiler, not the
> > > classpath
> > > > of the executing Ant. You'll need the Eclipse compiler JAR on Ant's
> > > > execution classpath to execute the javac task.
> > > >
> > > > This can be confusing when using the Eclipse compiler, since it
> > doesn't
> > > > have
> > > > any "default" classpath. Normally when you're using 'javac' from a
> > JDK,
> > > > the
> > > > classpath of the underlying JRE (all of the java.*, etc classes) is
> > > > automatically on the classpath. The Eclipse compiler is not part of
> a
> > > JDK,
> > > > so there is nothing on the classpath by default.
> > > >
> > > > -Nathan
> > > >
> > > > > -----Original Message-----
> > > > > From: Jordan Justen [mailto:jljusten@gmail.com]
> > > > > Sent: Sunday, August 27, 2006 8:49 PM
> > > > > To: harmony-dev@incubator.apache.org
> > > > > Subject: Re: [app] ant with ecj
> > > > >
> > > > > Richard,
> > > > >
> > > > > Yes, I also added ecj_3.2.jar to the CLASSPATH.
> > > > >
> > > > > Ant works fine, but the first time a javac task is encountered,
> the
> > > > > compiler
> > > > > complained that java.lang.Object was not found.  I then added
> > > > > jdk/jre/lib/boot/kernel.jar to CLASSPATH.  Now, I see an error
> that
> > > > > java.lang.String is not found, so I added luni.jar to CLASSPATH.
> > > etc...
> > > > >
> > > > > Since ant is basically working (mkdir tasks, delete tasks, java
> > tasks
> > > > all
> > > > > seem to work), I think the harmony jvm is loading these "boot"
> jars,
> > > but
> > > > > it
> > > > > seems like when the javac task uses ecj, those jars are not
> visible.
> > > > >
> > > > > I'm using windows xp, ant 1.6.5, and the latest harmony jdk
> > snapshot.
> > > > >
> > > > > Thanks again,
> > > > >
> > > > > -Jordan
> > > > >
> > > > > On 8/27/06, Richard Liang <ri...@gmail.com> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > > Jordan Justen wrote:
> > > > > > > Hi all.
> > > > > > >
> > > > > > > I'm trying to use ant with the ecj compiler.  I override the
> > > > compiler
> > > > > in
> > > > > > > build.xml like this:
> > > > > > >  <property name="build.compiler" value="
> > > > > > > org.eclipse.jdt.core.JDTCompilerAdapter" />
> > > > > > >
> > > > > > > This will execute the compiler, but I find I have to add each
> > jar
> > > > from
> > > > > > > jdk/jre/lib/boot to CLASSPATH or else ecj won't find the
> > standard
> > > > > > classes
> > > > > > > during compilation.
> > > > > > >
> > > > > > > This is probably user error, and not related to harmony.
> > :)  Does
> > > > > anyone
> > > > > > > know what I might be improperly configuring?
> > > > > > Hello Jordan,
> > > > > >
> > > > > > Do you mean the "build.compiler" property in
> make/build_java.xml?
> > I
> > > > just
> > > > > > give it a try by 1) overriding the compiler as what you have
> done
> > 2)
> > > > > > adding
> C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar
> > > > into
> > > > > > classpath.
> > > > > >
> > > > > > Everything works OK. :-) Could you give more detailed
> information
> > > > about
> > > > > > this issue? Thanks a lot.
> > > > > >
> > > > > > Best regards,
> > > > > > Richard
> > > > > > >
> > > > > > > Thanks,
> > > > > > >
> > > > > > > -Jordan
> > > > > > >
> > > > > >
> > > > > > --
> > > > > > Richard Liang
> > > > > > China Software Development Lab, IBM
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > --------------------------------------------------------------------
> > > -
> > > > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > > > To unsubscribe, e-mail:
> > harmony-dev-unsubscribe@incubator.apache.org
> > > > > > For additional commands, e-mail: harmony-dev-
> > > help@incubator.apache.org
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > > For additional commands, e-mail:
> harmony-dev-help@incubator.apache.org
> > > >
> > > >
> >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
>

Re: [app] ant with ecj

Posted by Alexey Petrenko <al...@gmail.com>.
2006/8/28, Jordan Justen <jl...@gmail.com>:
> My JAVA_HOME is set to harmony/jdk/jre.
>
> Are you sure ant is running with harmony's jvm and classlibs when JAVA_HOME
> is set to sun's path?
Ant can set bootclasspath for compiler or any other subsequent jvm
calls. But it will use original vm.
So if your JAVA_HOME set to RI then it will use RI vm and Harmony classes.

>
> I am wanting to use the harmony classlibs and jvm with ant and the ecj
> compiler.  Hopefully this would make no dependencies on sun's java.
>
> You know what.  I didn't explicitly mention that I was trying to run this
> with harmony.  Whoops, sorry.
>
> -Jordan
>
> On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
> >
> > The current build scripts should be doing this already. For example, this
> > is
> > a snippet from the 'luni' module's build script.
> >
> >         <javac sourcepath=""
> >                srcdir="${hy.luni.src.main.java}"
> >                destdir="${hy.build}"
> >                source="${hy.javac.source}"
> >                target="${hy.javac.target}"
> >                debug="${hy.javac.debug}">
> >             <bootclasspath>
> >                 <fileset dir="${hy.jdk}/jre/lib/boot">
> >                     <include name="**/*.jar" />
> >                 </fileset>
> >             </bootclasspath>
> >         </javac>
> >
> > It points to luni's source directory and puts everything in the deploy
> > (JDK)/jre/lib/boot folder on the bootclasspath to compile against. In the
> > case of "java.lang.Object", this should be in the "luni-kernel-stubs.jar".
> > If you're doing a full compile, then "java.lang.Object" should be included
> > in the source files.
> >
> > I just ran the build using the Eclipse compiler and it worked fine. Here's
> > what I did.
> > 1. Check out all of the code from the classlib trunk [1] down. You need
> > everything from the folder down.
> > 2. From the 'trunk' folder, run 'ant fetch-depends', which downloads all
> > of
> > the dependencies for the build.
> > 3. Grab the ecj_3.2.jar from the 'trunk/depends/jars/ecj_3.2' and copied
> > it
> > into my ANT_HOME/lib folder. This puts ECJ on Ant's classpath.
> > 4. From the 'trunk' folder, run 'ant build
> > -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter' and the entire
> > federated build runs.
> >
> > Is this similar to what you're doing? Note, I'm running Ant with JAVA_HOME
> > pointing to Sun's 5.0_7 JDK.
> >
> > -Nathan
> >
> > [1]
> >
> > https://svn.apache.org/repos/asf/incubator/harmony/enhanced/classlib/trunk/
> >
> > > -----Original Message-----
> > > From: Jordan Justen [mailto:jljusten@gmail.com]
> > > Sent: Sunday, August 27, 2006 10:31 PM
> > > To: harmony-dev@incubator.apache.org
> > > Subject: Re: [app] ant with ecj
> > >
> > > Nathan,
> > >
> > > Is there a way to have the javac/ecj task include all of standard
> > harmony
> > > jars without including them in the CLASSPATH environment variable?
> > >
> > > Thanks,
> > >
> > > -Jordan
> > >
> > > On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
> > > >
> > > > Keep in mind that the execution of the Ant scripts and the compilation
> > > are
> > > > two separate things, which means they are using two different
> > > classpaths.
> > > > If
> > > > the compilation task is complaining about a missing class, then this
> > > means
> > > > the class is missing from the classpath of the compiler, not the
> > > classpath
> > > > of the executing Ant. You'll need the Eclipse compiler JAR on Ant's
> > > > execution classpath to execute the javac task.
> > > >
> > > > This can be confusing when using the Eclipse compiler, since it
> > doesn't
> > > > have
> > > > any "default" classpath. Normally when you're using 'javac' from a
> > JDK,
> > > > the
> > > > classpath of the underlying JRE (all of the java.*, etc classes) is
> > > > automatically on the classpath. The Eclipse compiler is not part of a
> > > JDK,
> > > > so there is nothing on the classpath by default.
> > > >
> > > > -Nathan
> > > >
> > > > > -----Original Message-----
> > > > > From: Jordan Justen [mailto:jljusten@gmail.com]
> > > > > Sent: Sunday, August 27, 2006 8:49 PM
> > > > > To: harmony-dev@incubator.apache.org
> > > > > Subject: Re: [app] ant with ecj
> > > > >
> > > > > Richard,
> > > > >
> > > > > Yes, I also added ecj_3.2.jar to the CLASSPATH.
> > > > >
> > > > > Ant works fine, but the first time a javac task is encountered, the
> > > > > compiler
> > > > > complained that java.lang.Object was not found.  I then added
> > > > > jdk/jre/lib/boot/kernel.jar to CLASSPATH.  Now, I see an error that
> > > > > java.lang.String is not found, so I added luni.jar to CLASSPATH.
> > > etc...
> > > > >
> > > > > Since ant is basically working (mkdir tasks, delete tasks, java
> > tasks
> > > > all
> > > > > seem to work), I think the harmony jvm is loading these "boot" jars,
> > > but
> > > > > it
> > > > > seems like when the javac task uses ecj, those jars are not visible.
> > > > >
> > > > > I'm using windows xp, ant 1.6.5, and the latest harmony jdk
> > snapshot.
> > > > >
> > > > > Thanks again,
> > > > >
> > > > > -Jordan
> > > > >
> > > > > On 8/27/06, Richard Liang <ri...@gmail.com> wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > > Jordan Justen wrote:
> > > > > > > Hi all.
> > > > > > >
> > > > > > > I'm trying to use ant with the ecj compiler.  I override the
> > > > compiler
> > > > > in
> > > > > > > build.xml like this:
> > > > > > >  <property name="build.compiler" value="
> > > > > > > org.eclipse.jdt.core.JDTCompilerAdapter" />
> > > > > > >
> > > > > > > This will execute the compiler, but I find I have to add each
> > jar
> > > > from
> > > > > > > jdk/jre/lib/boot to CLASSPATH or else ecj won't find the
> > standard
> > > > > > classes
> > > > > > > during compilation.
> > > > > > >
> > > > > > > This is probably user error, and not related to harmony.
> > :)  Does
> > > > > anyone
> > > > > > > know what I might be improperly configuring?
> > > > > > Hello Jordan,
> > > > > >
> > > > > > Do you mean the "build.compiler" property in make/build_java.xml?
> > I
> > > > just
> > > > > > give it a try by 1) overriding the compiler as what you have done
> > 2)
> > > > > > adding C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar
> > > > into
> > > > > > classpath.
> > > > > >
> > > > > > Everything works OK. :-) Could you give more detailed information
> > > > about
> > > > > > this issue? Thanks a lot.
> > > > > >
> > > > > > Best regards,
> > > > > > Richard
> > > > > > >
> > > > > > > Thanks,
> > > > > > >
> > > > > > > -Jordan
> > > > > > >
> > > > > >
> > > > > > --
> > > > > > Richard Liang
> > > > > > China Software Development Lab, IBM
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > --------------------------------------------------------------------
> > > -
> > > > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > > > To unsubscribe, e-mail:
> > harmony-dev-unsubscribe@incubator.apache.org
> > > > > > For additional commands, e-mail: harmony-dev-
> > > help@incubator.apache.org
> > > > > >
> > > > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> > > >
> > > >
> >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
>


-- 
Alexey A. Petrenko
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [app] ant with ecj

Posted by Jordan Justen <jl...@gmail.com>.
My JAVA_HOME is set to harmony/jdk/jre.

Are you sure ant is running with harmony's jvm and classlibs when JAVA_HOME
is set to sun's path?

I am wanting to use the harmony classlibs and jvm with ant and the ecj
compiler.  Hopefully this would make no dependencies on sun's java.

You know what.  I didn't explicitly mention that I was trying to run this
with harmony.  Whoops, sorry.

-Jordan

On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
>
> The current build scripts should be doing this already. For example, this
> is
> a snippet from the 'luni' module's build script.
>
>         <javac sourcepath=""
>                srcdir="${hy.luni.src.main.java}"
>                destdir="${hy.build}"
>                source="${hy.javac.source}"
>                target="${hy.javac.target}"
>                debug="${hy.javac.debug}">
>             <bootclasspath>
>                 <fileset dir="${hy.jdk}/jre/lib/boot">
>                     <include name="**/*.jar" />
>                 </fileset>
>             </bootclasspath>
>         </javac>
>
> It points to luni's source directory and puts everything in the deploy
> (JDK)/jre/lib/boot folder on the bootclasspath to compile against. In the
> case of "java.lang.Object", this should be in the "luni-kernel-stubs.jar".
> If you're doing a full compile, then "java.lang.Object" should be included
> in the source files.
>
> I just ran the build using the Eclipse compiler and it worked fine. Here's
> what I did.
> 1. Check out all of the code from the classlib trunk [1] down. You need
> everything from the folder down.
> 2. From the 'trunk' folder, run 'ant fetch-depends', which downloads all
> of
> the dependencies for the build.
> 3. Grab the ecj_3.2.jar from the 'trunk/depends/jars/ecj_3.2' and copied
> it
> into my ANT_HOME/lib folder. This puts ECJ on Ant's classpath.
> 4. From the 'trunk' folder, run 'ant build
> -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter' and the entire
> federated build runs.
>
> Is this similar to what you're doing? Note, I'm running Ant with JAVA_HOME
> pointing to Sun's 5.0_7 JDK.
>
> -Nathan
>
> [1]
>
> https://svn.apache.org/repos/asf/incubator/harmony/enhanced/classlib/trunk/
>
> > -----Original Message-----
> > From: Jordan Justen [mailto:jljusten@gmail.com]
> > Sent: Sunday, August 27, 2006 10:31 PM
> > To: harmony-dev@incubator.apache.org
> > Subject: Re: [app] ant with ecj
> >
> > Nathan,
> >
> > Is there a way to have the javac/ecj task include all of standard
> harmony
> > jars without including them in the CLASSPATH environment variable?
> >
> > Thanks,
> >
> > -Jordan
> >
> > On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
> > >
> > > Keep in mind that the execution of the Ant scripts and the compilation
> > are
> > > two separate things, which means they are using two different
> > classpaths.
> > > If
> > > the compilation task is complaining about a missing class, then this
> > means
> > > the class is missing from the classpath of the compiler, not the
> > classpath
> > > of the executing Ant. You'll need the Eclipse compiler JAR on Ant's
> > > execution classpath to execute the javac task.
> > >
> > > This can be confusing when using the Eclipse compiler, since it
> doesn't
> > > have
> > > any "default" classpath. Normally when you're using 'javac' from a
> JDK,
> > > the
> > > classpath of the underlying JRE (all of the java.*, etc classes) is
> > > automatically on the classpath. The Eclipse compiler is not part of a
> > JDK,
> > > so there is nothing on the classpath by default.
> > >
> > > -Nathan
> > >
> > > > -----Original Message-----
> > > > From: Jordan Justen [mailto:jljusten@gmail.com]
> > > > Sent: Sunday, August 27, 2006 8:49 PM
> > > > To: harmony-dev@incubator.apache.org
> > > > Subject: Re: [app] ant with ecj
> > > >
> > > > Richard,
> > > >
> > > > Yes, I also added ecj_3.2.jar to the CLASSPATH.
> > > >
> > > > Ant works fine, but the first time a javac task is encountered, the
> > > > compiler
> > > > complained that java.lang.Object was not found.  I then added
> > > > jdk/jre/lib/boot/kernel.jar to CLASSPATH.  Now, I see an error that
> > > > java.lang.String is not found, so I added luni.jar to CLASSPATH.
> > etc...
> > > >
> > > > Since ant is basically working (mkdir tasks, delete tasks, java
> tasks
> > > all
> > > > seem to work), I think the harmony jvm is loading these "boot" jars,
> > but
> > > > it
> > > > seems like when the javac task uses ecj, those jars are not visible.
> > > >
> > > > I'm using windows xp, ant 1.6.5, and the latest harmony jdk
> snapshot.
> > > >
> > > > Thanks again,
> > > >
> > > > -Jordan
> > > >
> > > > On 8/27/06, Richard Liang <ri...@gmail.com> wrote:
> > > > >
> > > > >
> > > > >
> > > > > Jordan Justen wrote:
> > > > > > Hi all.
> > > > > >
> > > > > > I'm trying to use ant with the ecj compiler.  I override the
> > > compiler
> > > > in
> > > > > > build.xml like this:
> > > > > >  <property name="build.compiler" value="
> > > > > > org.eclipse.jdt.core.JDTCompilerAdapter" />
> > > > > >
> > > > > > This will execute the compiler, but I find I have to add each
> jar
> > > from
> > > > > > jdk/jre/lib/boot to CLASSPATH or else ecj won't find the
> standard
> > > > > classes
> > > > > > during compilation.
> > > > > >
> > > > > > This is probably user error, and not related to harmony.
> :)  Does
> > > > anyone
> > > > > > know what I might be improperly configuring?
> > > > > Hello Jordan,
> > > > >
> > > > > Do you mean the "build.compiler" property in make/build_java.xml?
> I
> > > just
> > > > > give it a try by 1) overriding the compiler as what you have done
> 2)
> > > > > adding C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar
> > > into
> > > > > classpath.
> > > > >
> > > > > Everything works OK. :-) Could you give more detailed information
> > > about
> > > > > this issue? Thanks a lot.
> > > > >
> > > > > Best regards,
> > > > > Richard
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > -Jordan
> > > > > >
> > > > >
> > > > > --
> > > > > Richard Liang
> > > > > China Software Development Lab, IBM
> > > > >
> > > > >
> > > > >
> > > > >
> --------------------------------------------------------------------
> > -
> > > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > > To unsubscribe, e-mail:
> harmony-dev-unsubscribe@incubator.apache.org
> > > > > For additional commands, e-mail: harmony-dev-
> > help@incubator.apache.org
> > > > >
> > > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> > >
> > >
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

Re: [app] ant with ecj

Posted by Richard Liang <ri...@gmail.com>.
Hello Jordan,

All the boot jars have been add in the javac tasks. Could you please 
paste the stack trace? Thanks a lot.

Please refer to modules/luni/build.xml
<javac>
....
            <bootclasspath>
                <fileset dir="${hy.jdk}/jre/lib/boot">
                    <include name="**/*.jar" />
                </fileset>
            </bootclasspath>

Best regards,
Richard

Jordan Justen wrote:
> Nathan,
>
> Is there a way to have the javac/ecj task include all of standard harmony
> jars without including them in the CLASSPATH environment variable?
>
> Thanks,
>
> -Jordan
>
> On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
>>
>> Keep in mind that the execution of the Ant scripts and the 
>> compilation are
>> two separate things, which means they are using two different 
>> classpaths.
>> If
>> the compilation task is complaining about a missing class, then this 
>> means
>> the class is missing from the classpath of the compiler, not the 
>> classpath
>> of the executing Ant. You'll need the Eclipse compiler JAR on Ant's
>> execution classpath to execute the javac task.
>>
>> This can be confusing when using the Eclipse compiler, since it doesn't
>> have
>> any "default" classpath. Normally when you're using 'javac' from a JDK,
>> the
>> classpath of the underlying JRE (all of the java.*, etc classes) is
>> automatically on the classpath. The Eclipse compiler is not part of a 
>> JDK,
>> so there is nothing on the classpath by default.
>>
>> -Nathan
>>
>> > -----Original Message-----
>> > From: Jordan Justen [mailto:jljusten@gmail.com]
>> > Sent: Sunday, August 27, 2006 8:49 PM
>> > To: harmony-dev@incubator.apache.org
>> > Subject: Re: [app] ant with ecj
>> >
>> > Richard,
>> >
>> > Yes, I also added ecj_3.2.jar to the CLASSPATH.
>> >
>> > Ant works fine, but the first time a javac task is encountered, the
>> > compiler
>> > complained that java.lang.Object was not found.  I then added
>> > jdk/jre/lib/boot/kernel.jar to CLASSPATH.  Now, I see an error that
>> > java.lang.String is not found, so I added luni.jar to CLASSPATH.  
>> etc...
>> >
>> > Since ant is basically working (mkdir tasks, delete tasks, java tasks
>> all
>> > seem to work), I think the harmony jvm is loading these "boot" 
>> jars, but
>> > it
>> > seems like when the javac task uses ecj, those jars are not visible.
>> >
>> > I'm using windows xp, ant 1.6.5, and the latest harmony jdk snapshot.
>> >
>> > Thanks again,
>> >
>> > -Jordan
>> >
>> > On 8/27/06, Richard Liang <ri...@gmail.com> wrote:
>> > >
>> > >
>> > >
>> > > Jordan Justen wrote:
>> > > > Hi all.
>> > > >
>> > > > I'm trying to use ant with the ecj compiler.  I override the
>> compiler
>> > in
>> > > > build.xml like this:
>> > > >  <property name="build.compiler" value="
>> > > > org.eclipse.jdt.core.JDTCompilerAdapter" />
>> > > >
>> > > > This will execute the compiler, but I find I have to add each jar
>> from
>> > > > jdk/jre/lib/boot to CLASSPATH or else ecj won't find the standard
>> > > classes
>> > > > during compilation.
>> > > >
>> > > > This is probably user error, and not related to harmony. :)  Does
>> > anyone
>> > > > know what I might be improperly configuring?
>> > > Hello Jordan,
>> > >
>> > > Do you mean the "build.compiler" property in make/build_java.xml? I
>> just
>> > > give it a try by 1) overriding the compiler as what you have done 2)
>> > > adding C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar
>> into
>> > > classpath.
>> > >
>> > > Everything works OK. :-) Could you give more detailed information
>> about
>> > > this issue? Thanks a lot.
>> > >
>> > > Best regards,
>> > > Richard
>> > > >
>> > > > Thanks,
>> > > >
>> > > > -Jordan
>> > > >
>> > >
>> > > --
>> > > Richard Liang
>> > > China Software Development Lab, IBM
>> > >
>> > >
>> > >
>> > > 
>> ---------------------------------------------------------------------
>> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
>> > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> > > For additional commands, e-mail: 
>> harmony-dev-help@incubator.apache.org
>> > >
>> > >
>>
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>
>>
>

-- 
Richard Liang
China Software Development Lab, IBM 



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


RE: [app] ant with ecj

Posted by Nathan Beyer <nb...@kc.rr.com>.
The current build scripts should be doing this already. For example, this is
a snippet from the 'luni' module's build script.

        <javac sourcepath=""
               srcdir="${hy.luni.src.main.java}"
               destdir="${hy.build}"
               source="${hy.javac.source}"
               target="${hy.javac.target}"
               debug="${hy.javac.debug}">
            <bootclasspath>
                <fileset dir="${hy.jdk}/jre/lib/boot">
                    <include name="**/*.jar" />
                </fileset>
            </bootclasspath>
        </javac>

It points to luni's source directory and puts everything in the deploy
(JDK)/jre/lib/boot folder on the bootclasspath to compile against. In the
case of "java.lang.Object", this should be in the "luni-kernel-stubs.jar".
If you're doing a full compile, then "java.lang.Object" should be included
in the source files.

I just ran the build using the Eclipse compiler and it worked fine. Here's
what I did.
1. Check out all of the code from the classlib trunk [1] down. You need
everything from the folder down.
2. From the 'trunk' folder, run 'ant fetch-depends', which downloads all of
the dependencies for the build.
3. Grab the ecj_3.2.jar from the 'trunk/depends/jars/ecj_3.2' and copied it
into my ANT_HOME/lib folder. This puts ECJ on Ant's classpath.
4. From the 'trunk' folder, run 'ant build
-Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter' and the entire
federated build runs.

Is this similar to what you're doing? Note, I'm running Ant with JAVA_HOME
pointing to Sun's 5.0_7 JDK.

-Nathan

[1]
https://svn.apache.org/repos/asf/incubator/harmony/enhanced/classlib/trunk/

> -----Original Message-----
> From: Jordan Justen [mailto:jljusten@gmail.com]
> Sent: Sunday, August 27, 2006 10:31 PM
> To: harmony-dev@incubator.apache.org
> Subject: Re: [app] ant with ecj
> 
> Nathan,
> 
> Is there a way to have the javac/ecj task include all of standard harmony
> jars without including them in the CLASSPATH environment variable?
> 
> Thanks,
> 
> -Jordan
> 
> On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
> >
> > Keep in mind that the execution of the Ant scripts and the compilation
> are
> > two separate things, which means they are using two different
> classpaths.
> > If
> > the compilation task is complaining about a missing class, then this
> means
> > the class is missing from the classpath of the compiler, not the
> classpath
> > of the executing Ant. You'll need the Eclipse compiler JAR on Ant's
> > execution classpath to execute the javac task.
> >
> > This can be confusing when using the Eclipse compiler, since it doesn't
> > have
> > any "default" classpath. Normally when you're using 'javac' from a JDK,
> > the
> > classpath of the underlying JRE (all of the java.*, etc classes) is
> > automatically on the classpath. The Eclipse compiler is not part of a
> JDK,
> > so there is nothing on the classpath by default.
> >
> > -Nathan
> >
> > > -----Original Message-----
> > > From: Jordan Justen [mailto:jljusten@gmail.com]
> > > Sent: Sunday, August 27, 2006 8:49 PM
> > > To: harmony-dev@incubator.apache.org
> > > Subject: Re: [app] ant with ecj
> > >
> > > Richard,
> > >
> > > Yes, I also added ecj_3.2.jar to the CLASSPATH.
> > >
> > > Ant works fine, but the first time a javac task is encountered, the
> > > compiler
> > > complained that java.lang.Object was not found.  I then added
> > > jdk/jre/lib/boot/kernel.jar to CLASSPATH.  Now, I see an error that
> > > java.lang.String is not found, so I added luni.jar to CLASSPATH.
> etc...
> > >
> > > Since ant is basically working (mkdir tasks, delete tasks, java tasks
> > all
> > > seem to work), I think the harmony jvm is loading these "boot" jars,
> but
> > > it
> > > seems like when the javac task uses ecj, those jars are not visible.
> > >
> > > I'm using windows xp, ant 1.6.5, and the latest harmony jdk snapshot.
> > >
> > > Thanks again,
> > >
> > > -Jordan
> > >
> > > On 8/27/06, Richard Liang <ri...@gmail.com> wrote:
> > > >
> > > >
> > > >
> > > > Jordan Justen wrote:
> > > > > Hi all.
> > > > >
> > > > > I'm trying to use ant with the ecj compiler.  I override the
> > compiler
> > > in
> > > > > build.xml like this:
> > > > >  <property name="build.compiler" value="
> > > > > org.eclipse.jdt.core.JDTCompilerAdapter" />
> > > > >
> > > > > This will execute the compiler, but I find I have to add each jar
> > from
> > > > > jdk/jre/lib/boot to CLASSPATH or else ecj won't find the standard
> > > > classes
> > > > > during compilation.
> > > > >
> > > > > This is probably user error, and not related to harmony. :)  Does
> > > anyone
> > > > > know what I might be improperly configuring?
> > > > Hello Jordan,
> > > >
> > > > Do you mean the "build.compiler" property in make/build_java.xml? I
> > just
> > > > give it a try by 1) overriding the compiler as what you have done 2)
> > > > adding C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar
> > into
> > > > classpath.
> > > >
> > > > Everything works OK. :-) Could you give more detailed information
> > about
> > > > this issue? Thanks a lot.
> > > >
> > > > Best regards,
> > > > Richard
> > > > >
> > > > > Thanks,
> > > > >
> > > > > -Jordan
> > > > >
> > > >
> > > > --
> > > > Richard Liang
> > > > China Software Development Lab, IBM
> > > >
> > > >
> > > >
> > > > --------------------------------------------------------------------
> -
> > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > > For additional commands, e-mail: harmony-dev-
> help@incubator.apache.org
> > > >
> > > >
> >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [app] ant with ecj

Posted by Jordan Justen <jl...@gmail.com>.
Nathan,

Is there a way to have the javac/ecj task include all of standard harmony
jars without including them in the CLASSPATH environment variable?

Thanks,

-Jordan

On 8/27/06, Nathan Beyer <nb...@kc.rr.com> wrote:
>
> Keep in mind that the execution of the Ant scripts and the compilation are
> two separate things, which means they are using two different classpaths.
> If
> the compilation task is complaining about a missing class, then this means
> the class is missing from the classpath of the compiler, not the classpath
> of the executing Ant. You'll need the Eclipse compiler JAR on Ant's
> execution classpath to execute the javac task.
>
> This can be confusing when using the Eclipse compiler, since it doesn't
> have
> any "default" classpath. Normally when you're using 'javac' from a JDK,
> the
> classpath of the underlying JRE (all of the java.*, etc classes) is
> automatically on the classpath. The Eclipse compiler is not part of a JDK,
> so there is nothing on the classpath by default.
>
> -Nathan
>
> > -----Original Message-----
> > From: Jordan Justen [mailto:jljusten@gmail.com]
> > Sent: Sunday, August 27, 2006 8:49 PM
> > To: harmony-dev@incubator.apache.org
> > Subject: Re: [app] ant with ecj
> >
> > Richard,
> >
> > Yes, I also added ecj_3.2.jar to the CLASSPATH.
> >
> > Ant works fine, but the first time a javac task is encountered, the
> > compiler
> > complained that java.lang.Object was not found.  I then added
> > jdk/jre/lib/boot/kernel.jar to CLASSPATH.  Now, I see an error that
> > java.lang.String is not found, so I added luni.jar to CLASSPATH.  etc...
> >
> > Since ant is basically working (mkdir tasks, delete tasks, java tasks
> all
> > seem to work), I think the harmony jvm is loading these "boot" jars, but
> > it
> > seems like when the javac task uses ecj, those jars are not visible.
> >
> > I'm using windows xp, ant 1.6.5, and the latest harmony jdk snapshot.
> >
> > Thanks again,
> >
> > -Jordan
> >
> > On 8/27/06, Richard Liang <ri...@gmail.com> wrote:
> > >
> > >
> > >
> > > Jordan Justen wrote:
> > > > Hi all.
> > > >
> > > > I'm trying to use ant with the ecj compiler.  I override the
> compiler
> > in
> > > > build.xml like this:
> > > >  <property name="build.compiler" value="
> > > > org.eclipse.jdt.core.JDTCompilerAdapter" />
> > > >
> > > > This will execute the compiler, but I find I have to add each jar
> from
> > > > jdk/jre/lib/boot to CLASSPATH or else ecj won't find the standard
> > > classes
> > > > during compilation.
> > > >
> > > > This is probably user error, and not related to harmony. :)  Does
> > anyone
> > > > know what I might be improperly configuring?
> > > Hello Jordan,
> > >
> > > Do you mean the "build.compiler" property in make/build_java.xml? I
> just
> > > give it a try by 1) overriding the compiler as what you have done 2)
> > > adding C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar
> into
> > > classpath.
> > >
> > > Everything works OK. :-) Could you give more detailed information
> about
> > > this issue? Thanks a lot.
> > >
> > > Best regards,
> > > Richard
> > > >
> > > > Thanks,
> > > >
> > > > -Jordan
> > > >
> > >
> > > --
> > > Richard Liang
> > > China Software Development Lab, IBM
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> > >
> > >
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

RE: [app] ant with ecj

Posted by Nathan Beyer <nb...@kc.rr.com>.
Keep in mind that the execution of the Ant scripts and the compilation are
two separate things, which means they are using two different classpaths. If
the compilation task is complaining about a missing class, then this means
the class is missing from the classpath of the compiler, not the classpath
of the executing Ant. You'll need the Eclipse compiler JAR on Ant's
execution classpath to execute the javac task.

This can be confusing when using the Eclipse compiler, since it doesn't have
any "default" classpath. Normally when you're using 'javac' from a JDK, the
classpath of the underlying JRE (all of the java.*, etc classes) is
automatically on the classpath. The Eclipse compiler is not part of a JDK,
so there is nothing on the classpath by default.

-Nathan

> -----Original Message-----
> From: Jordan Justen [mailto:jljusten@gmail.com]
> Sent: Sunday, August 27, 2006 8:49 PM
> To: harmony-dev@incubator.apache.org
> Subject: Re: [app] ant with ecj
> 
> Richard,
> 
> Yes, I also added ecj_3.2.jar to the CLASSPATH.
> 
> Ant works fine, but the first time a javac task is encountered, the
> compiler
> complained that java.lang.Object was not found.  I then added
> jdk/jre/lib/boot/kernel.jar to CLASSPATH.  Now, I see an error that
> java.lang.String is not found, so I added luni.jar to CLASSPATH.  etc...
> 
> Since ant is basically working (mkdir tasks, delete tasks, java tasks all
> seem to work), I think the harmony jvm is loading these "boot" jars, but
> it
> seems like when the javac task uses ecj, those jars are not visible.
> 
> I'm using windows xp, ant 1.6.5, and the latest harmony jdk snapshot.
> 
> Thanks again,
> 
> -Jordan
> 
> On 8/27/06, Richard Liang <ri...@gmail.com> wrote:
> >
> >
> >
> > Jordan Justen wrote:
> > > Hi all.
> > >
> > > I'm trying to use ant with the ecj compiler.  I override the compiler
> in
> > > build.xml like this:
> > >  <property name="build.compiler" value="
> > > org.eclipse.jdt.core.JDTCompilerAdapter" />
> > >
> > > This will execute the compiler, but I find I have to add each jar from
> > > jdk/jre/lib/boot to CLASSPATH or else ecj won't find the standard
> > classes
> > > during compilation.
> > >
> > > This is probably user error, and not related to harmony. :)  Does
> anyone
> > > know what I might be improperly configuring?
> > Hello Jordan,
> >
> > Do you mean the "build.compiler" property in make/build_java.xml? I just
> > give it a try by 1) overriding the compiler as what you have done 2)
> > adding C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar into
> > classpath.
> >
> > Everything works OK. :-) Could you give more detailed information about
> > this issue? Thanks a lot.
> >
> > Best regards,
> > Richard
> > >
> > > Thanks,
> > >
> > > -Jordan
> > >
> >
> > --
> > Richard Liang
> > China Software Development Lab, IBM
> >
> >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [app] ant with ecj

Posted by Jordan Justen <jl...@gmail.com>.
Richard,

Yes, I also added ecj_3.2.jar to the CLASSPATH.

Ant works fine, but the first time a javac task is encountered, the compiler
complained that java.lang.Object was not found.  I then added
jdk/jre/lib/boot/kernel.jar to CLASSPATH.  Now, I see an error that
java.lang.String is not found, so I added luni.jar to CLASSPATH.  etc...

Since ant is basically working (mkdir tasks, delete tasks, java tasks all
seem to work), I think the harmony jvm is loading these "boot" jars, but it
seems like when the javac task uses ecj, those jars are not visible.

I'm using windows xp, ant 1.6.5, and the latest harmony jdk snapshot.

Thanks again,

-Jordan

On 8/27/06, Richard Liang <ri...@gmail.com> wrote:
>
>
>
> Jordan Justen wrote:
> > Hi all.
> >
> > I'm trying to use ant with the ecj compiler.  I override the compiler in
> > build.xml like this:
> >  <property name="build.compiler" value="
> > org.eclipse.jdt.core.JDTCompilerAdapter" />
> >
> > This will execute the compiler, but I find I have to add each jar from
> > jdk/jre/lib/boot to CLASSPATH or else ecj won't find the standard
> classes
> > during compilation.
> >
> > This is probably user error, and not related to harmony. :)  Does anyone
> > know what I might be improperly configuring?
> Hello Jordan,
>
> Do you mean the "build.compiler" property in make/build_java.xml? I just
> give it a try by 1) overriding the compiler as what you have done 2)
> adding C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar into
> classpath.
>
> Everything works OK. :-) Could you give more detailed information about
> this issue? Thanks a lot.
>
> Best regards,
> Richard
> >
> > Thanks,
> >
> > -Jordan
> >
>
> --
> Richard Liang
> China Software Development Lab, IBM
>
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

Re: [app] ant with ecj

Posted by Richard Liang <ri...@gmail.com>.

Jordan Justen wrote:
> Hi all.
>
> I'm trying to use ant with the ecj compiler.  I override the compiler in
> build.xml like this:
>  <property name="build.compiler" value="
> org.eclipse.jdt.core.JDTCompilerAdapter" />
>
> This will execute the compiler, but I find I have to add each jar from
> jdk/jre/lib/boot to CLASSPATH or else ecj won't find the standard classes
> during compilation.
>
> This is probably user error, and not related to harmony. :)  Does anyone
> know what I might be improperly configuring?
Hello Jordan,

Do you mean the "build.compiler" property in make/build_java.xml? I just 
give it a try by 1) overriding the compiler as what you have done 2) 
adding C:\harmony\workspace\trunk\depends\jars\ecj_3.2\ecj_3.2.jar into 
classpath.

Everything works OK. :-) Could you give more detailed information about 
this issue? Thanks a lot.

Best regards,
Richard
>
> Thanks,
>
> -Jordan
>

-- 
Richard Liang
China Software Development Lab, IBM 



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org