You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "KARR, DAVID (ATTCINW)" <dk...@att.com> on 2009/12/11 17:58:19 UTC

How to print out resulting classpath from a classpath variable?

I'm trying to debug a problem with an Ant script executing differently
between the command line and Eclipse.  It comes down to Eclipse not
seeming to get the same classpath as on the command line.  I define the
classpath that a task (OpenJPA PCTaskEnhancer) needs with an embedded
"classpath" element.  It might be useful if I could print out the
resulting classpath according to that classpath variable and see if it
looks differently on the command line and Eclipse.

Is there some way I can print out the resulting contents of a classpath
according to a saved "path" element?

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


AW: How to print out resulting classpath from a classpath variable?

Posted by "Knuplesch, Juergen" <Ju...@icongmbh.de>.
Hello,

Maybe you have a problem with the compile classpath in Eclipse. You have to export all the jars you need to compile the stuff
In Eclipse. There is a checkbox for every jar in the "Order and export" tab of your classpath.
If you have classpaths inside your jars things are even worse.

Or do you use Ant to compile inside Eclipse?
How do you know what the classpath inside Eclipse is? 
Especially when you have more than one project it becomes tuff.

Please tell us, how you determine the Eclipse classpath.

(Ant4eclipse could help you to figure out the exact classpath inside Eclipse.)


Greetings

Juergen
-- 
Jürgen Knuplesch                    
-----Ursprüngliche Nachricht-----
Von: KARR, DAVID (ATTCINW) [mailto:dk068x@att.com] 
Gesendet: Freitag, 11. Dezember 2009 18:16
An: Ant Users List
Betreff: RE: How to print out resulting classpath from a classpath variable?

> -----Original Message-----
> From: Knuplesch, Juergen [mailto:Juergen.Knuplesch@icongmbh.de]
> Sent: Friday, December 11, 2009 9:04 AM
> To: Ant Users List
> Subject: AW: How to print out resulting classpath from a classpath 
> variable?
> 
> Hello
> 
> By the way: I use ant4eclipse to get the same classpath as Eclipse.

Understood, but I think that's the wrong approach.  I think the command line build should be most important, and we do what we have to do to get the Eclipse build working from that.  In any case, it's my command-line build that's working, it's the Eclipse build that's failing.

> I do it this way (I think Steve showed me that):
> classpath is a refid of a path
> 
>     <!-- den Klassenpfad druckbar machen -->
>     <pathconvert pathsep="${line.separator}|   |-- "
>                  property="echo.compile.classpath"
>                  refid="classpath">

This worked perfectly, thanks.

It didn't help me figure out what the problem was, but this part worked at least.  The classpath came out exactly as I expected, and it was the same on the command line and Eclipse, but for some reason when it runs in Eclipse it fails to find the "persistence.xml" file, which is stored in one of the classpath entries.

I might post a separate note on this issue.

>     </pathconvert>
>     <!-- Klassenpfad ausgeben -->
>     <echo level="info" 
> message="---------------------------------------
> -----------------"/>
>     <echo level="info" message=" Property Classpath="/>
>     <echo level="info" message="|   |-- ${echo.compile.classpath}"/>
>     <echo level="info" 
> message="---------------------------------------
> -----------------"/>
> 
> 
> --
> Jürgen Knuplesch
> -----Ursprüngliche Nachricht-----
> Von: KARR, DAVID (ATTCINW) [mailto:dk068x@att.com]
> Gesendet: Freitag, 11. Dezember 2009 17:58
> An: user@ant.apache.org
> Betreff: How to print out resulting classpath from a classpath 
> variable?
> 
> I'm trying to debug a problem with an Ant script executing differently 
> between the command line and Eclipse.  It comes down to Eclipse not 
> seeming to get the same classpath as on the command line.  I define 
> the classpath that a task (OpenJPA PCTaskEnhancer) needs with an 
> embedded "classpath" element.  It might be useful if I could print out 
> the resulting classpath according to that classpath variable and see 
> if it looks differently on the command line and Eclipse.
> 
> Is there some way I can print out the resulting contents of a 
> classpath according to a saved "path" element?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional 
> commands, e-mail: user-help@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional 
> commands, e-mail: user-help@ant.apache.org


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


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


RE: How to print out resulting classpath from a classpath variable?

Posted by "KARR, DAVID (ATTCINW)" <dk...@att.com>.
> -----Original Message-----
> From: Knuplesch, Juergen [mailto:Juergen.Knuplesch@icongmbh.de]
> Sent: Friday, December 11, 2009 9:04 AM
> To: Ant Users List
> Subject: AW: How to print out resulting classpath from a classpath
> variable?
> 
> Hello
> 
> By the way: I use ant4eclipse to get the same classpath as Eclipse.

Understood, but I think that's the wrong approach.  I think the command line build should be most important, and we do what we have to do to get the Eclipse build working from that.  In any case, it's my command-line build that's working, it's the Eclipse build that's failing.

> I do it this way (I think Steve showed me that):
> classpath is a refid of a path
> 
>     <!-- den Klassenpfad druckbar machen -->
>     <pathconvert pathsep="${line.separator}|   |-- "
>                  property="echo.compile.classpath"
>                  refid="classpath">

This worked perfectly, thanks.

It didn't help me figure out what the problem was, but this part worked at least.  The classpath came out exactly as I expected, and it was the same on the command line and Eclipse, but for some reason when it runs in Eclipse it fails to find the "persistence.xml" file, which is stored in one of the classpath entries.

I might post a separate note on this issue.

>     </pathconvert>
>     <!-- Klassenpfad ausgeben -->
>     <echo level="info" message="---------------------------------------
> -----------------"/>
>     <echo level="info" message=" Property Classpath="/>
>     <echo level="info" message="|   |-- ${echo.compile.classpath}"/>
>     <echo level="info" message="---------------------------------------
> -----------------"/>
> 
> 
> --
> Jürgen Knuplesch
> -----Ursprüngliche Nachricht-----
> Von: KARR, DAVID (ATTCINW) [mailto:dk068x@att.com]
> Gesendet: Freitag, 11. Dezember 2009 17:58
> An: user@ant.apache.org
> Betreff: How to print out resulting classpath from a classpath
> variable?
> 
> I'm trying to debug a problem with an Ant script executing differently
> between the command line and Eclipse.  It comes down to Eclipse not
> seeming to get the same classpath as on the command line.  I define the
> classpath that a task (OpenJPA PCTaskEnhancer) needs with an embedded
> "classpath" element.  It might be useful if I could print out the
> resulting classpath according to that classpath variable and see if it
> looks differently on the command line and Eclipse.
> 
> Is there some way I can print out the resulting contents of a classpath
> according to a saved "path" element?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
> commands, e-mail: user-help@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


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


AW: How to print out resulting classpath from a classpath variable?

Posted by "Knuplesch, Juergen" <Ju...@icongmbh.de>.
Hello

By the way: I use ant4eclipse to get the same classpath as Eclipse.

I do it this way (I think Steve showed me that):
classpath is a refid of a path


    <!-- den Klassenpfad druckbar machen -->
    <pathconvert pathsep="${line.separator}|   |-- "
                 property="echo.compile.classpath"
                 refid="classpath">
    </pathconvert>
    <!-- Klassenpfad ausgeben -->
    <echo level="info" message="--------------------------------------------------------"/>
    <echo level="info" message=" Property Classpath="/>
    <echo level="info" message="|   |-- ${echo.compile.classpath}"/>
    <echo level="info" message="--------------------------------------------------------"/> 


-- 
Jürgen Knuplesch 
-----Ursprüngliche Nachricht-----
Von: KARR, DAVID (ATTCINW) [mailto:dk068x@att.com] 
Gesendet: Freitag, 11. Dezember 2009 17:58
An: user@ant.apache.org
Betreff: How to print out resulting classpath from a classpath variable?

I'm trying to debug a problem with an Ant script executing differently between the command line and Eclipse.  It comes down to Eclipse not seeming to get the same classpath as on the command line.  I define the classpath that a task (OpenJPA PCTaskEnhancer) needs with an embedded "classpath" element.  It might be useful if I could print out the resulting classpath according to that classpath variable and see if it looks differently on the command line and Eclipse.

Is there some way I can print out the resulting contents of a classpath according to a saved "path" element?

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


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