ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Saxtoft">
Subject RE: Escapign backslash in java.home
Date Tue, 16 Nov 2004 09:10:38 GMT
The thing is that the java.home I get from ant already contains the

My script looks like this:
<target name="createServerXml">
    <replaceregexp file="${oc4j_home}/config/server.xml"
    match="&lt;java-compiler [^>]*/>"
    replace="&lt;java-compiler bindir=&quot;${java.home}/bin&quot;

I need to change the backslash contained in the property (java.home) to
a frontslash, before writing to the file. When written to the file the
backslash has disappeared, and thus it is too late to replace it.

By using ${java.home} the idea is always to get the correct path to jdk,
on either OS; Windows or Linux.



-----Original Message-----
From: Conelly, Luis (GE Energy, Non GE, GENE)
Sent: Monday, November 15, 2004 3:24 PM
To: Ant Users List
Subject: RE: Escapign backslash in java.home

why don't you use forward-slashes instead backslashes?

It is the same for Java and it fits on Win & *nix systems; of course, it
won't work the same on any OS, since in Win you have this horrible
drives concept (C: D: etc)


(for Win)

(for *nix)

bottom line, you have to write properties for both OSes and pick them on
the fly by using something like <condition> [1] task. This kind of
operation has been discused in this list several times [2]

Hope this helps


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message