tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Petteys" <m...@arcticmail.com>
Subject RE: ant question..
Date Mon, 01 Nov 1999 18:44:13 GMT

> > Ant is crashing on me with a null pointer exception if I don't reference
> > javaVersion before it is compared with startsWith("1.1")in
> > ant.taskdefs.Javac.doClassicCompile().  Any ideas why getJavaVersion
> returns
> > null until it is called twice or javaVersion is referenced in
> > getJavaVersion?  I am probably missing something stupid..
>
> Very strange. I don't have 1.1.x on my system right now (I'm downloading
> 1.1.8 right now to look at it on win98) but I've just checked in some code
> that will force the version detection to take place up front
> rather than on
> demand and that will also print out the Java version detected when ant is
> started up.

Very strange indeed..  It compiles alright if you set the JAVA_COMPILER to
none, if you reference javaVersion before the end of the the first call to
getJavaVersion(), or if you do printStackTrace on the exception in the catch
in getJavaVersion().  It is fixed in the current build because the first
null that detectJavaVersion() returns in Project() isn't used by anything
and/or by the log statement.

java version 1.1.6
jakarta-tools_19991027132343.tar.gz - slightly modified..

C:\jakarta-tomcat\jakarta-tools\ant>set JAVA_COMPILER=

C:\jakarta-tomcat\jakarta-tools\ant>bootstrap -v
BOOTSTRAPPING ANT DISTRIBUTION
** CONFIGURING COMMANDS FOR NT SYSTEM
** COMPILING ANT CLASSES
** COPYING REQUIRED FILES
** BUILDING ANT DISTRIBUTION
Buildfile: build.xml
Project base dir set to: C:\jakarta-tomcat\jakarta-tools\ant
 +Target: main
   +Task: mkdir
   +Task: javac
 +Target: dist
   +Task: jar
 +Target: foo
   +Task: jar
 +Target: clean
   +Task: deltree
Executing Target: main
Created dir: C:\jakarta-tomcat\jakarta-tools\ant\build
Compiling 16 source files to C:\jakarta-tomcat\jakarta-tools\ant\build
Using classic compiler
java.lang.NullPointerException
        at org.apache.tools.ant.taskdefs.Javac.doClassicCompile(Compiled
Code)
        at org.apache.tools.ant.taskdefs.Javac.execute(Compiled Code)
        at org.apache.tools.ant.Target.execute(Compiled Code)
        at org.apache.tools.ant.Project.executeTarget(Compiled Code)
        at org.apache.tools.ant.Project.executeTarget(Compiled Code)
        at org.apache.tools.ant.Project.executeTarget(Project.java:205)
        at org.apache.tools.ant.Main.runBuild(Compiled Code)
        at org.apache.tools.ant.Main.main(Compiled Code)
** DONE BOOTSTRAPPING ANT DISTRIBUTION
C:\jakarta-tomcat\jakarta-tools\ant>set JAVA_COMPILER=none

C:\jakarta-tomcat\jakarta-tools\ant>bootstrap -v
BOOTSTRAPPING ANT DISTRIBUTION
** CONFIGURING COMMANDS FOR NT SYSTEM
** COMPILING ANT CLASSES
Warning: JIT compiler "none" not found. Will use interpreter.
Warning: JIT compiler "none" not found. Will use interpreter.
** COPYING REQUIRED FILES
** BUILDING ANT DISTRIBUTION
Warning: JIT compiler "none" not found. Will use interpreter.
Buildfile: build.xml
Project base dir set to: C:\jakarta-tomcat\jakarta-tools\ant
 +Target: main
   +Task: mkdir
   +Task: javac
 +Target: dist
   +Task: jar
 +Target: foo
   +Task: jar
 +Target: clean
   +Task: deltree
Executing Target: main
Created dir: C:\jakarta-tomcat\jakarta-tools\ant\build
Compiling 16 source files to C:\jakarta-tomcat\jakarta-tools\ant\build
Using classic compiler
Compilation args: [-deprecation, -d,
C:\jakarta-tomcat\jakarta-tools\ant\build,
-classpath,
C:\jakarta-tomcat\jakarta-tools\ant\build;C:\jakarta-tomcat\jakarta-
tools\ant\lib\projectx-tr2.jar;c:\java\lib\classes.zip;..\projectx-tr2.jar;.
.\ja
vac.jar;tmp;C:\jakarta-tomcat\jakarta-tools\ant\src\main, -g]
Files to be compiled:

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\BuildExcep
tion.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\DesirableF
ilter.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\Main.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\Project.ja
va

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\ProjectHel

per.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\Target.jav
a

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\Task.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\taskdefs\C
hmod.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\taskdefs\C
opydir.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\taskdefs\C
opyfile.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\taskdefs\D
eltree.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\taskdefs\E
xec.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\taskdefs\J
ar.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\taskdefs\J
avac.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\taskdefs\M
kdir.java

C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\taskdefs\R
mic.java

Copying 2 support files to C:\jakarta-tomcat\jakarta-tools\ant\build
Copy:
C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\defaultM
anifest.mf >
C:\jakarta-tomcat\jakarta-tools\ant\build\org\apache\tools\ant\defa
ultManifest.mf
Copy:
C:\jakarta-tomcat\jakarta-tools\ant\src\main\org\apache\tools\ant\taskdefs
\defaults.properties >
C:\jakarta-tomcat\jakarta-tools\ant\build\org\apache\tool
s\ant\taskdefs\defaults.properties
Executing Target: dist
Building jar: C:\jakarta-tomcat\jakarta-tools\ant.jar
Completed in 8 seconds
** DONE BOOTSTRAPPING ANT DISTRIBUTION
C:\jakarta-tomcat\jakarta-tools\ant>


Mime
View raw message