Hi, did you try <javac> with includeAntRuntime="false" ?
Rainer > -----Original Message----- > From: Michael Böckling [mailto:[EMAIL PROTECTED] > Sent: Monday, September 19, 2005 3:20 PM > To: user@ant.apache.org > Subject: Problem concerning classpath priority (I think) > > > 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\sr > c\com\giniality\taj\v1\checkstyle\plugin\UCImplClassPackageCon > structorOnly.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\sr > c\com\giniality\taj\v1\checkstyle\plugin\UCImplClassPackageCon > structorOnly.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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]