You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Fergus Gallagher <Fe...@OrbisUK.com> on 2000/02/04 15:38:31 UTC

Problem building ant with JDK1.3 modern

I tried changing build.compiler to "modern" in build.xml but the
generated lib\ant.jar is tiny and doesn't contain any classes - just the
properties.  The problem's presumably in the javac since the build
directory doesn't contain any classes.

Changing things back to "classic" & running bootstrap brings things back
fine.

Can anybody else replicate this?  I am using JDK 1.3 rc1 on NT

Fergus

======= OUTPUT ===============

H:\cvswork\jakarta-ant>build
Buildfile: build.xml
Detected Java Version: 1.3
Project base dir set to: H:\cvswork\jakarta-ant
Executing Target: init
Executing Target: prepare
Created dir: H:\cvswork\jakarta-ant\build
Executing Target: compile
Created dir: H:\cvswork\jakarta-ant\build\classes
Compiling 39 source files to H:\cvswork\jakarta-ant\build\classes
Performing a Modern Compile
Copying 3 support files to H:\cvswork\jakarta-ant\build\classes
Executing Target: jar
Building jar: H:\cvswork\jakarta-ant\lib\ant.jar
Executing Target: main
Completed in 6 seconds

H:\cvswork\jakarta-ant>build
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/tools/ant/
Main

H:\cvswork\jakarta-ant>jar -tvf lib\ant.jar
     0 Fri Feb 04 14:25:24 GMT+00:00 2000 META-INF/
    62 Fri Feb 04 14:25:24 GMT+00:00 2000 META-INF/MANIFEST.MF
     0 Fri Feb 04 14:25:24 GMT+00:00 2000 org/
     0 Fri Feb 04 14:25:24 GMT+00:00 2000 org/apache/
     0 Fri Feb 04 14:25:24 GMT+00:00 2000 org/apache/tools/
     0 Fri Feb 04 14:25:24 GMT+00:00 2000 org/apache/tools/ant/
     0 Fri Feb 04 14:25:24 GMT+00:00 2000 org/apache/tools/ant/taskdefs/
  1120 Fri Feb 04 14:25:24 GMT+00:00 2000
org/apache/tools/ant/taskdefs/defaults
.properties
    22 Fri Feb 04 14:25:24 GMT+00:00 2000
org/apache/tools/ant/defaultManifest.m
f
    37 Fri Feb 04 14:25:24 GMT+00:00 2000
org/apache/tools/ant/parser.properties

H:\cvswork\jakarta-ant>dir *.class /s
 Volume in drive H is fgallagh
 Volume Serial Number is 1568-256C

File Not Found



-- 
Fergus Gallagher          Tel: +44 (20) 89 87 07 17
Orbis                     Fax: +44 (20) 87 42 26 49
The Swan Centre           email: Fergus.Gallagher@orbisuk.com
Fishers Lane              Web: http://www.orbisuk.com
London W4 1RX / UK

RE: Problem building ant with JDK1.3 modern

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
> -----Original Message-----
> From: William Ferguson [mailto:williamf@mincom.com]
>
> Conor,
>
> I well realise I was replying to something from 5 months ago - I had to
> specifically look it up in the archives :-)
>
> The reason I did so, was because our version of Ant (18th April 2000)
> wasn't implementing the modern build. And as far as I could tell from
> the archives, there didn't seem to be any follow up to the original
> posts.

Actually, it is a topic that comes up regularly :-)

>
> As you suggested I have downloaded recent (5th July) source and will use
> that (it has some olther features I want anyway).
>
> BTW All the recent binaries appear to be zero length .. ? Is this
> because of the changes to the nightly builds lately? Soory if this seems
> a stupid question, but I'm relatively new to this list.

No its not a stupid question. The old nightly build process does not
bootstrap ant but simply builds ant with an existing copy of ant itself.
Normally that is OK. If, however, a new feature is introduced into ant and
immediately used in ant's own build.xml file, the old version of ant will
not be able to build the new version. This is why the old nightly build
process is failing.

Sam Ruby has introduced a new nightly build process for ant which bootstraps
ant to avoid this problem. Ant now has its own nightly build which is good.

Conor


RE: Problem building ant with JDK1.3 modern

Posted by William Ferguson <wi...@mincom.com>.
Conor,

I well realise I was replying to something from 5 months ago - I had to
specifically look it up in the archives :-)

The reason I did so, was because our version of Ant (18th April 2000)
wasn't implementing the modern build. And as far as I could tell from
the archives, there didn't seem to be any follow up to the original
posts.

As you suggested I have downloaded recent (5th July) source and will use
that (it has some olther features I want anyway).

BTW All the recent binaries appear to be zero length .. ? Is this
because of the changes to the nightly builds lately? Soory if this seems
a stupid question, but I'm relatively new to this list.


William Ferguson
williamf@mincom.com


This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please
delete it and notify the sender. The contents of this E-mail are the
opinion of the writer only and are not endorsed by Mincom Limited unless
expressly stated otherwise.


> -----Original Message-----
> From: Conor MacNeill [mailto:conor@cortexebusiness.com.au]
> Sent: Thursday, 6 July 2000 10:27
> To: ant-dev@jakarta.apache.org
> Subject: RE: Problem building ant with JDK1.3 modern
>
>
> William,
>
> You are replying to a mail sent about 5 months ago !!
>
> This has now been implemented. Get the latest nightly build
> or the latest
> code from CVS.
>
> http://jakarta.apache.org/builds/ant/nightly/
>
> Conor


RE: Problem building ant with JDK1.3 modern

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
William,

You are replying to a mail sent about 5 months ago !!

This has now been implemented. Get the latest nightly build or the latest
code from CVS.

http://jakarta.apache.org/builds/ant/nightly/

Conor

> -----Original Message-----
> From: William Ferguson [mailto:williamf@mincom.com]
> Sent: Thursday, 6 July 2000 10:18
> To: ant-dev@jakarta.apache.org
> Subject: RE: Problem building ant with JDK1.3 modern
>
>
> Since the distinction between the classic and modern switches for the
> Javac task hasn't/can't be implemented, wouldn't it be appropriate to
> remove the option in the code and doc?
>
>
> William Ferguson
>
> This transmission is for the intended addressee only and is confidential
> information. If you have received this transmission in error, please
> delete it and notify the sender. The contents of this E-mail are the
> opinion of the writer only and are not endorsed by Mincom Limited unless
> expressly stated otherwise.
>
>
> > -----Original Message-----
> > From: Fergus Gallagher [mailto:Fergus.Gallagher@OrbisUK.com]
> > Sent: Wednesday, 9 February 2000 22:17
> > To: ant-dev@jakarta.apache.org
> > Subject: Re: Problem building ant with JDK1.3 modern
> >
> >
> > I'm not sure but it looks to me like com.sun.tools.javac.Main invokes
> > the "modern" compiler by default.  Conversely, I can't see
> > how to invoke
> > the "classic" compiler.
> >
> > Fergus
> >
> > James Duncan Davidson wrote:
> > >
> > > > Doh!   I guess I should have looked at the source carefully - this
> > > > compiler hasn't been implemented!
> > >
> > > Oops. This was a skeleton that I stubbed in to be filled in.. It was
> > > before the 1.3 stuff was widely used, so I thought I had
> > time.. Guess
> > > not.
> > >
> > > It's easy enough to steal the code from the classic
> > compiler section --
> > > the syntax differences in the command aren't much
> > different. Mainly it's
> > > just a switch in the classname of the entry point
> > > com.sun.tools.javac.Main I beleive.
> > >
> > > .duncan
> > >
> > > --
> > > James Davidson
> > duncan@eng.sun.com
> > > Java + XML / Portable Code + Portable Data
> > !try; do()
> >
> > --
> > Fergus Gallagher          Tel: +44 (20) 89 87 07 17
> > Orbis                     Fax: +44 (20) 87 42 26 49
> > The Swan Centre           email: Fergus.Gallagher@orbisuk.com
> > Fishers Lane              Web: http://www.orbisuk.com
> > London W4 1RX / UK
> >
>
>


RE: Problem building ant with JDK1.3 modern

Posted by William Ferguson <wi...@mincom.com>.
Since the distinction between the classic and modern switches for the
Javac task hasn't/can't be implemented, wouldn't it be appropriate to
remove the option in the code and doc?


William Ferguson

This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please
delete it and notify the sender. The contents of this E-mail are the
opinion of the writer only and are not endorsed by Mincom Limited unless
expressly stated otherwise.


> -----Original Message-----
> From: Fergus Gallagher [mailto:Fergus.Gallagher@OrbisUK.com]
> Sent: Wednesday, 9 February 2000 22:17
> To: ant-dev@jakarta.apache.org
> Subject: Re: Problem building ant with JDK1.3 modern
>
>
> I'm not sure but it looks to me like com.sun.tools.javac.Main invokes
> the "modern" compiler by default.  Conversely, I can't see
> how to invoke
> the "classic" compiler.
>
> Fergus
>
> James Duncan Davidson wrote:
> >
> > > Doh!   I guess I should have looked at the source carefully - this
> > > compiler hasn't been implemented!
> >
> > Oops. This was a skeleton that I stubbed in to be filled in.. It was
> > before the 1.3 stuff was widely used, so I thought I had
> time.. Guess
> > not.
> >
> > It's easy enough to steal the code from the classic
> compiler section --
> > the syntax differences in the command aren't much
> different. Mainly it's
> > just a switch in the classname of the entry point
> > com.sun.tools.javac.Main I beleive.
> >
> > .duncan
> >
> > --
> > James Davidson
> duncan@eng.sun.com
> > Java + XML / Portable Code + Portable Data
> !try; do()
>
> --
> Fergus Gallagher          Tel: +44 (20) 89 87 07 17
> Orbis                     Fax: +44 (20) 87 42 26 49
> The Swan Centre           email: Fergus.Gallagher@orbisuk.com
> Fishers Lane              Web: http://www.orbisuk.com
> London W4 1RX / UK
>


Re: Problem building ant with JDK1.3 modern

Posted by Fergus Gallagher <Fe...@OrbisUK.com>.
I'm not sure but it looks to me like com.sun.tools.javac.Main invokes
the "modern" compiler by default.  Conversely, I can't see how to invoke
the "classic" compiler.

Fergus

James Duncan Davidson wrote:
> 
> > Doh!   I guess I should have looked at the source carefully - this
> > compiler hasn't been implemented!
> 
> Oops. This was a skeleton that I stubbed in to be filled in.. It was
> before the 1.3 stuff was widely used, so I thought I had time.. Guess
> not.
> 
> It's easy enough to steal the code from the classic compiler section --
> the syntax differences in the command aren't much different. Mainly it's
> just a switch in the classname of the entry point
> com.sun.tools.javac.Main I beleive.
> 
> .duncan
> 
> --
> James Davidson                                     duncan@eng.sun.com
> Java + XML / Portable Code + Portable Data                 !try; do()

-- 
Fergus Gallagher          Tel: +44 (20) 89 87 07 17
Orbis                     Fax: +44 (20) 87 42 26 49
The Swan Centre           email: Fergus.Gallagher@orbisuk.com
Fishers Lane              Web: http://www.orbisuk.com
London W4 1RX / UK

Re: Problem building ant with JDK1.3 modern

Posted by James Duncan Davidson <ja...@eng.sun.com>.
> Doh!   I guess I should have looked at the source carefully - this
> compiler hasn't been implemented!

Oops. This was a skeleton that I stubbed in to be filled in.. It was
before the 1.3 stuff was widely used, so I thought I had time.. Guess
not.

It's easy enough to steal the code from the classic compiler section --
the syntax differences in the command aren't much different. Mainly it's
just a switch in the classname of the entry point
com.sun.tools.javac.Main I beleive.

.duncan

-- 
James Davidson                                     duncan@eng.sun.com 
Java + XML / Portable Code + Portable Data                 !try; do()

Re: Problem building ant with JDK1.3 modern

Posted by Fergus Gallagher <Fe...@OrbisUK.com>.
Doh!   I guess I should have looked at the source carefully - this
compiler hasn't been implemented!

May I suggest that someone changes the docs and source in case someone
else falls for it like me...

Fergus

    /**
     * Performs a compile using the newer compiler that ships with JDK
1.3
     */

    private void doModernCompile() throws BuildException {
        project.log("Performing a Modern Compile");
    }



Fergus Gallagher wrote:
> 
> I tried changing build.compiler to "modern" in build.xml but the
> generated lib\ant.jar is tiny and doesn't contain any classes - just the
> properties.  The problem's presumably in the javac since the build
> directory doesn't contain any classes.
> 
> Changing things back to "classic" & running bootstrap brings things back
> fine.
> 
> Can anybody else replicate this?  I am using JDK 1.3 rc1 on NT
> 
> Fergus
> 
> ======= OUTPUT ===============
> 
> H:\cvswork\jakarta-ant>build
> Buildfile: build.xml
> Detected Java Version: 1.3
> Project base dir set to: H:\cvswork\jakarta-ant
> Executing Target: init
> Executing Target: prepare
> Created dir: H:\cvswork\jakarta-ant\build
> Executing Target: compile
> Created dir: H:\cvswork\jakarta-ant\build\classes
> Compiling 39 source files to H:\cvswork\jakarta-ant\build\classes
> Performing a Modern Compile
> Copying 3 support files to H:\cvswork\jakarta-ant\build\classes
> Executing Target: jar
> Building jar: H:\cvswork\jakarta-ant\lib\ant.jar
> Executing Target: main
> Completed in 6 seconds
> 
> H:\cvswork\jakarta-ant>build
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/tools/ant/
> Main
> 
> H:\cvswork\jakarta-ant>jar -tvf lib\ant.jar
>      0 Fri Feb 04 14:25:24 GMT+00:00 2000 META-INF/
>     62 Fri Feb 04 14:25:24 GMT+00:00 2000 META-INF/MANIFEST.MF
>      0 Fri Feb 04 14:25:24 GMT+00:00 2000 org/
>      0 Fri Feb 04 14:25:24 GMT+00:00 2000 org/apache/
>      0 Fri Feb 04 14:25:24 GMT+00:00 2000 org/apache/tools/
>      0 Fri Feb 04 14:25:24 GMT+00:00 2000 org/apache/tools/ant/
>      0 Fri Feb 04 14:25:24 GMT+00:00 2000 org/apache/tools/ant/taskdefs/
>   1120 Fri Feb 04 14:25:24 GMT+00:00 2000
> org/apache/tools/ant/taskdefs/defaults
> .properties
>     22 Fri Feb 04 14:25:24 GMT+00:00 2000
> org/apache/tools/ant/defaultManifest.m
> f
>     37 Fri Feb 04 14:25:24 GMT+00:00 2000
> org/apache/tools/ant/parser.properties
> 
> H:\cvswork\jakarta-ant>dir *.class /s
>  Volume in drive H is fgallagh
>  Volume Serial Number is 1568-256C
> 
> File Not Found
> 
> --
> Fergus Gallagher          Tel: +44 (20) 89 87 07 17
> Orbis                     Fax: +44 (20) 87 42 26 49
> The Swan Centre           email: Fergus.Gallagher@orbisuk.com
> Fishers Lane              Web: http://www.orbisuk.com
> London W4 1RX / UK

-- 
Fergus Gallagher          Tel: +44 (20) 89 87 07 17
Orbis                     Fax: +44 (20) 87 42 26 49
The Swan Centre           email: Fergus.Gallagher@orbisuk.com
Fishers Lane              Web: http://www.orbisuk.com
London W4 1RX / UK