ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jerry Odenwelder <Jerry.Odenwel...@Mentisys.com>
Subject javac classpath problem
Date Wed, 20 Jun 2001 22:59:56 GMT
First, I'm an ant neophyte so I'm sure that I'm doing something wrong (also
because I've searched the list history and could not find this question). 

Before I start I'm using "Ant version 1.3 compiled on March 2 2001" (from
ant -version) on a Dell machine running Windows 2000

Here is my problem:
I want to build a classpath that I may override from a config file or by
passing parameters from another build file.  I was having problem using the
classpath option for the javac task so I've referred to the Antidote
build.xml for this method.  However, for some reason my classpath is not
being altered when javac is executed. 

Here's my build.xml file:

<project name="Test" default="build">

<!-- 
    Properties
-->

<property name="outputDir" value="."/>

<property name="JmxLibDir"     value="c:\jdk1.3\jmx\lib"/>
<property name="LdapLibDir"    value="c:\jdk1.3\jndi\lib"/>
<property name="WeblogicHome"  value="c:\weblogic"/>

<property name="JmxLibs"
value="${JmxLibDir}\jmxri.jar;${JmxLibDir}\jmxgrinder.jar;${JmxLibDir}\jmxto
ols.jar"/>
<property name="LdapLibs"
value="${LdapLibDir}\jndi.jar;${LdapLibDir}\ldap.jar;${LdapLibDir}\ldapbp.ja
r"/>
<property name="WeblogicLibs"
value="${WeblogicHome}\classes;${WeblogicHome}\lib\weblogicaux.jar"/>

<!-- 
    Build Classpath
-->
<path id="classpath">
    <pathelement location="${JmxLibs}"/>
    <pathelement location="${WeblogicLibs}"/>
    <pathelement location="${LdapLibs}"/>
    <pathelement location="${outputDir}"/>
</path>

<!-- 
    Initial target
-->
   <target name="init" >
      <tstamp/>
   </target>

<!-- 
    Build Target 
-->
   <target name="build" depends="init">
      <echo> classfiles written to ${outputDir} </echo>
      <javac srcdir="." 
             destdir="${outputDir}">
        <classpath refid="classpath" />
      </javac>
   </target>
</project>

And here is the result of my built

C:\antTest>ant -verbose
Ant version 1.3 compiled on March 2 2001

Buildfile: build.xml
Detected Java Version: 1.3
Detected OS: Windows 2000
parsing buildfile C:\antTest\build.xml with URI = file:C:/antTest/build.xml
Project base dir set to: C:\antTest
Build sequence for target `build' is [init, build]
Complete build sequence is [init, build, clean]

init:

build:
     [echo]  classfiles written to .
    [javac] MessageProcessor.java added as C:\antTest\MessageProcessor.class
doe
sn't exist.
    [javac] build.xml skipped - don't know how to handle it
    [javac] Compiling 1 source file to C:\antTest
    [javac] Using modern compiler
    [javac] Compilation args: -d C:\antTest -classpath
"C:\antTest;C:\jdk1.3\lib
\tools.jar;C:\Program Files\ant\lib\jakarta-ant-1.3-optional.jar;C:\Program
File
s\ant\lib\parser.jar;C:\Program Files\ant\lib\jaxp.jar;C:\Program
Files\ant\lib\
ant.jar;C:\WINNT\SYSTEM32;C:\WINNT;C:\WINNT\SYSTEM32\WBEM;C:\DMI\bin;C:\;C:\
DELL
;C:\WINNT\JAVA\CLASSES\RxAssistant.zip" -sourcepath C:\antTest
    [javac] File to be compiled:
    C:\antTest\MessageProcessor.java

    [javac] C:\antTest\MessageProcessor.java:16: cannot resolve symbol
    [javac] symbol  : class MessageListener
    [javac] location: package jms
    [javac] import javax.jms.MessageListener;
    [javac]                  ^
    [javac] C:\antTest\MessageProcessor.java:17: cannot resolve symbol
    [javac] symbol  : class Message
    [javac] location: package jms
    [javac] import javax.jms.Message;
    [javac]                  ^
    [javac] C:\antTest\MessageProcessor.java:25: cannot resolve symbol
    [javac] symbol  : class MessageListener
    [javac] location: interface MessageProcessor
    [javac] public interface MessageProcessor extends MessageListener
    [javac]                                           ^
    [javac] C:\antTest\MessageProcessor.java:33: cannot resolve symbol
    [javac] symbol  : class Message
    [javac] location: interface MessageProcessor
    [javac]     public void onMessage(Message message);
    [javac]                           ^
    [javac] 4 errors

BUILD FAILED

C:\antTest\build.xml:57: Compile failed, messages should have been provided.

Total time: 1 second
C:\antTest>

So what am I doing wrong that the classpath not being set properly?

Mime
View raw message