Ant 1.3 doesn't know anything about OsX, so the environment support is
not there, Execute.getProcEnvCommand() returns null for the command
string.

Download the Ant sources from
<http://jakarta.apache.org/builds/jakarta-ant/release/v1.3/src/jakarta-ant-1.3-src.tar.gz>
and there is one small change you will need to make in:

jakarta-ant-1.3/src/main/org/apache/tools/ant/taskdefs/Execute.java


replace this:

        if ( osname.indexOf("mac os") >= 0 ) {
            // Mac
            // TODO: I have no idea how to get it, someone must fix it
            String[] cmd = null;
            return cmd;
        }

with this:

        if ( osname.indexOf("mac os") >= 0 ) {
            // Mac - it can work in OsX (os.version >= 10), so we'll check for it
            String  osVersStr = System.getProperty( "os.version" );
            int     osVersion = 0;
            int     dotIndex = osVersStr.indexOf( "." );
            if ( dotIndex > 0 ) {
                osVersStr = osVersStr.substring( 0, dotIndex );
                }
            osVersion = Integer.parseInt( osVersStr );
            if ( osVersion >= 10 ) {
                String[]    cmd = {"/usr/bin/env"};
                return cmd;
                }

            // otherwise, not implemented
            String[]    cmd = null;
            return cmd;
        }

I would have generated a patch but I'm just too tired of OsX to restart
today.

Given that you already have Ant installed, you don't need to worry about
the bootstrap process, just run "ant dist" and copy the newly built jar
files into the ant/lib directory.


BCD said at 10:22 AM -0700 on 7/6/01:

> Hi,
> 
> I've been successfully using Jboss and MySql on Mac OS X but am having
> trouble building the examples with Ant.  When I used the supplied build.xml
> file (with all of the environment variables set correctly) I get the
> following Java IOException (see below) when Ant is trying to read "env" to
> get the JBOSS_DIST environment variable.  If I hardcode the location of
> JBOSS_DIST in the build.xml the build completes correctly.
> 
> I'm wondering if this is a problem with the Java1.3 implementation that
> comes bundled on Mac OS X?  Has anyone else seen this problem or not had
> this problem on Mac OS X?
> 
> TIA,
> Bryan
> 
> 
> java.io.IOException
>         at 
> org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.jav
> a:520)
>         at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:329)
>         at 
> org.apache.tools.ant.taskdefs.Execute.getProcEnvironment(Execute.java:159)
>         at 
> org.apache.tools.ant.taskdefs.Property.loadEnvironment(Property.java:244)
>         at org.apache.tools.ant.taskdefs.Property.execute(Property.java:172)
>         at 
> org.apache.tools.ant.ProjectHelper$TaskHandler.finished(ProjectHelper.java:4
> 82)
>         at 
> org.apache.tools.ant.ProjectHelper$AbstractHandler.endElement(ProjectHelper.
> java:204)
>         at com.sun.xml.parser.Parser.maybeElement(Parser.java:1413)
>         at com.sun.xml.parser.Parser.content(Parser.java:1499)
>         at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
>         at com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
>         at com.sun.xml.parser.Parser.parse(Parser.java:284)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
>         at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:117)
>         at 
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:85)
>         at org.apache.tools.ant.Main.runBuild(Main.java:403)
>         at org.apache.tools.ant.Main.main(Main.java:149)

-- 
 Dave Ely <[EMAIL PROTECTED]>
 <http://www.dijas.com/>

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to