ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Böckling <Michael.Boeckl...@giniality.com>
Subject Problem concerning classpath priority (I think)
Date Mon, 19 Sep 2005 13:19:55 GMT
Hello!

I have a strange problem when compiling a project using an ANT task that 
doesn't show up when compiling directly in Eclipse.
To build our projects, we have a standardized building system that 
consists of many XML files and did its job (afaik) well in the past. Now 
I have a project uses the java.util.regex package, but whenever I try to 
build it, only the org.apache.regex package is found, and javac 
complains. Here's the output:

    [javac] Compiling 9 source files to 
C:\DEVELOPMENT\Workspaces\TAJ-1-CodingStandardsCustomChecks\bin
    [javac] 
C:\DEVELOPMENT\Workspaces\TAJ-1-CodingStandardsCustomChecks\src\com\giniality\taj\v1\checkstyle\plugin\UCImplClassPackageConstructorOnly.java:118:

cannot resolve symbol
    [javac] symbol  : method matcher (java.lang.String)
    [javac] location: class org.apache.regexp.RE
    [javac] return getRegexp().matcher(aClassIdent.getText()).find();
    [javac] ^
...
corresponding source:
return getRegexp().matcher(aClassIdent.getText()).find();

The error occurs in all 9 classes, since they all use regular expressions.
When I modify the source to split the statement (so the import 
java.util.regex is used), it says:

    [javac] Compiling 9 source files to 
C:\DEVELOPMENT\Workspaces\TAJ-1-CodingStandardsCustomChecks\bin
    [javac] 
C:\DEVELOPMENT\Workspaces\TAJ-1-CodingStandardsCustomChecks\src\com\giniality\taj\v1\checkstyle\plugin\UCImplClassPackageConstructorOnly.java:120:

incompatible types
    [javac] found   : org.apache.regexp.RE
    [javac] required: java.util.regex.Pattern
    [javac] Pattern p = getRegexp();
    [javac] ^
...
corresponding source:
        Pattern p = getRegexp();
        Matcher m = p.matcher(aClassIdent.getText());
        return m.find();

The package org.apache.regexp.RE is definitely the wrong one, but when I 
modify the sourcecode to explicitly import to java.util.regex, the 
compiler throws a "incompatible type" error. One way or another, only 
org.apache.regex gets found, while java.util.regex doesn't.
I'm a bit of a newbie with ANT (I didn't create the build system), so 
forgive me if the answer to my question seems obvious. Anyway, I'd 
really appreciate your help because i'm definitely stuck.

Many thanks in advance,
    Michael Böckling



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message