You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Larry Yates <ly...@adelphia.net> on 2001/03/13 03:47:26 UTC

Problems with CLASSPATH

Hi,
I'm trying to compile with a classpath that I define at runtime, but the
compile uses
the environment CLASSPATH. The "Compilation args" show that the PATH I
define is not used.

What am I doing wrong?

Here is the build.xml:
<project name="Ecom" default="compile" basedir=".">
   <property name="app.name" value="release2"/>
   <property name="deploy.home"
value="/test/applications/demo/${app.name}"/>
   <property name="classes" value="${deploy.home}/servletclasses"/>

   <path id="project.class.path">
     <fileset dir="/">
       <include name="${java.home}/lib/classes.zip,
                      ${java.home}/lib/servletclasses.zip,
                      ${java.home}/lib/tsmp.jar,
                      ${classes},
                      ${deploy.home}/lib/xerces.jar,
                      ${deploy.home}/lib/xalan.jar" />
     </fileset>
   </path>

   <target name="compile">
      <rmic  base="${deploy.home}/servletclasses"
             includes="**/*Impl.class"
           <classpath refid="project.class.path" />
      </rmic>
   </target>
</project>

Thanks for any and all help!
-Larry


Re: DUH...Why can't I get AWK to work?

Posted by Peter Donald <do...@apache.org>.
At 08:24  14/3/01 -0500, Larry Yates wrote:
>For some reason, I can't get awk to work properly from Ant although it works
>OK from the command line. Everything 'looks' OK (i.e. the directory does
>contain html files)...

When doing it on the command line the * is expanded while when passing it
via ant it is not expanded and thus fails.

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Re: Problems with CLASSPATH

Posted by Stefan Bodewig <bo...@apache.org>.
Larry Yates <ly...@adelphia.net> wrote:

> Is this the correct way to use this property?
> 
> <property name="build.sysclasspath" value="ignore"/>

either this way or from the command line -Dbuild.sysclasspath=ignore.

> What other (if any) values can be assigned?

It has been documented after the relase, see
<http://jakarta.apache.org/cvsweb/index.cgi/jakarta-ant/docs/manual/sysclasspath.html>
for the current version.

Stefan

RE: DUH...Why can't I get AWK to work?

Posted by Larry Yates <ly...@adelphia.net>.
Thanks!
Actually, using "ExecOn" versus "Exec" cured my wildcard expansion problem.

However, I dumped the whole thing (awk/sed/et al) for the "REPLACE" task.

...like I tell everybody, Ant is the GREATEST THING SINCE SLICED BREAD!!!

-Larry
-----Original Message-----
From: Conor MacNeill [mailto:conor@cortexebusiness.com.au]
Sent: Wednesday, March 14, 2001 8:49 PM
To: ant-user@jakarta.apache.org
Subject: RE: DUH...Why can't I get AWK to work?


Larry,

Wildcard expansion under Unix is performed by the shell. It is not performed
by Ant so you are passing *.html straight to awk. You should probably change
the executable to /bin/sh and pass the awk command as an argument.

Conor


> -----Original Message-----
> From: Larry Yates [mailto:lyates1@adelphia.net]
> Sent: Thursday, 15 March 2001 12:25 PM
> To: ant-user@jakarta.apache.org
> Subject: DUH...Why can't I get AWK to work?
>
>
> For some reason, I can't get awk to work properly from Ant
> although it works
> OK from the command line. Everything 'looks' OK (i.e. the directory does
> contain html files)...
>
> Any ideas?
> Is there another way of making transformations (editing) on a
> list of files?
>
> Here's the relevant part of the build.xml file:
>    <target name="modify">
>       <property name="from" value="servlet/" />
>       <property name="to"   value="servletdemo/" />
>       <exec dir="${html}" executable="awk" os="NONSTOP_KERNEL" >
>         <arg line="'gsub(&quot;${from}&quot;,&quot;${to}&quot;)'
> ${html}/*.html"/>
>       </exec>
>    </target>
>
> and here's the log:
> modify:
>      [exec] Myos = NONSTOP_KERNEL
>      [exec] awk 'gsub("servlet/","servletdemo/")'
> /test/applications/demo/release2/html/*.html
>      [exec] awk: Cannot find or open file
> /test/applications/demo/release2/html/*.html.
>      [exec]
>      [exec]  The source line number is 1.
>      [exec] Result: 2
>
> BUILD SUCCESSFUL
>
> Thanks!
> -Larry
>
>


RE: DUH...Why can't I get AWK to work?

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

Wildcard expansion under Unix is performed by the shell. It is not performed
by Ant so you are passing *.html straight to awk. You should probably change
the executable to /bin/sh and pass the awk command as an argument.

Conor


> -----Original Message-----
> From: Larry Yates [mailto:lyates1@adelphia.net]
> Sent: Thursday, 15 March 2001 12:25 PM
> To: ant-user@jakarta.apache.org
> Subject: DUH...Why can't I get AWK to work?
>
>
> For some reason, I can't get awk to work properly from Ant
> although it works
> OK from the command line. Everything 'looks' OK (i.e. the directory does
> contain html files)...
>
> Any ideas?
> Is there another way of making transformations (editing) on a
> list of files?
>
> Here's the relevant part of the build.xml file:
>    <target name="modify">
>       <property name="from" value="servlet/" />
>       <property name="to"   value="servletdemo/" />
>       <exec dir="${html}" executable="awk" os="NONSTOP_KERNEL" >
>         <arg line="'gsub(&quot;${from}&quot;,&quot;${to}&quot;)'
> ${html}/*.html"/>
>       </exec>
>    </target>
>
> and here's the log:
> modify:
>      [exec] Myos = NONSTOP_KERNEL
>      [exec] awk 'gsub("servlet/","servletdemo/")'
> /test/applications/demo/release2/html/*.html
>      [exec] awk: Cannot find or open file
> /test/applications/demo/release2/html/*.html.
>      [exec]
>      [exec]  The source line number is 1.
>      [exec] Result: 2
>
> BUILD SUCCESSFUL
>
> Thanks!
> -Larry
>
>


DUH...Why can't I get AWK to work?

Posted by Larry Yates <ly...@adelphia.net>.
For some reason, I can't get awk to work properly from Ant although it works
OK from the command line. Everything 'looks' OK (i.e. the directory does
contain html files)...

Any ideas?
Is there another way of making transformations (editing) on a list of files?

Here's the relevant part of the build.xml file:
   <target name="modify">
      <property name="from" value="servlet/" />
      <property name="to"   value="servletdemo/" />
      <exec dir="${html}" executable="awk" os="NONSTOP_KERNEL" >
        <arg line="'gsub(&quot;${from}&quot;,&quot;${to}&quot;)'
${html}/*.html"/>
      </exec>
   </target>

and here's the log:
modify:
     [exec] Myos = NONSTOP_KERNEL
     [exec] awk 'gsub("servlet/","servletdemo/")'
/test/applications/demo/release2/html/*.html
     [exec] awk: Cannot find or open file
/test/applications/demo/release2/html/*.html.
     [exec]
     [exec]  The source line number is 1.
     [exec] Result: 2

BUILD SUCCESSFUL

Thanks!
-Larry


RE: Problems with CLASSPATH

Posted by Larry Yates <ly...@adelphia.net>.
Is this the correct way to use this property?

<property name="build.sysclasspath" value="ignore"/>

...or is it a <target> attribute?

What other (if any) values can be assigned?

Thanks!
-Larry

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Wednesday, March 14, 2001 6:52 AM
To: ant-user@jakarta.apache.org
Subject: Re: Problems with CLASSPATH


Martin Monsorno <mo...@exolution.de> wrote:

> Isn't it possible to make ant NOT use the CLASSPATH settings of the 
> environment?

Set the magic property build.sysclasspath to ignore.

I'm afraid, this has been undocumented in the release.

Stefan

Re: Problems with CLASSPATH

Posted by Stefan Bodewig <bo...@apache.org>.
Martin Monsorno <mo...@exolution.de> wrote:

> Isn't it possible to make ant NOT use the CLASSPATH settings of the 
> environment?

Set the magic property build.sysclasspath to ignore.

I'm afraid, this has been undocumented in the release.

Stefan

Re: Problems with CLASSPATH

Posted by Martin Monsorno <mo...@exolution.de>.
Got the same problem, but my resulting classpath is the environmental
CLASSPATH + the one I specified.

Isn't it possible to make ant NOT use the CLASSPATH settings of the 
environment?

Larry Yates wrote:
> 
> Hi,
> I'm trying to compile with a classpath that I define at runtime, but the
> compile uses
> the environment CLASSPATH. The "Compilation args" show that the PATH I
> define is not used.
> 
> What am I doing wrong?
> 
> Here is the build.xml:
> <project name="Ecom" default="compile" basedir=".">
>    <property name="app.name" value="release2"/>
>    <property name="deploy.home"
> value="/test/applications/demo/${app.name}"/>
>    <property name="classes" value="${deploy.home}/servletclasses"/>
> 
>    <path id="project.class.path">
>      <fileset dir="/">
>        <include name="${java.home}/lib/classes.zip,
>                       ${java.home}/lib/servletclasses.zip,
>                       ${java.home}/lib/tsmp.jar,
>                       ${classes},
>                       ${deploy.home}/lib/xerces.jar,
>                       ${deploy.home}/lib/xalan.jar" />
>      </fileset>
>    </path>
> 
>    <target name="compile">
>       <rmic  base="${deploy.home}/servletclasses"
>              includes="**/*Impl.class"
>            <classpath refid="project.class.path" />
>       </rmic>
>    </target>
> </project>
> 
> Thanks for any and all help!
> -Larry

-- 
Martin Monsorno
mailto:Martin.Monsorno@exolution.de