You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2011/01/05 04:22:34 UTC

DO NOT REPLY [Bug 50542] New: Getting java.io.IOException when trying to use property environment

https://issues.apache.org/bugzilla/show_bug.cgi?id=50542

           Summary: Getting java.io.IOException when trying to use
                    property environment
           Product: Ant
           Version: 1.5.2
          Platform: PC
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: t3knoid@yahoo.com


I am getting the following when trying to access system variables using
<property environment> task:

 [property] java.io.IOException: Cannot run program "command.com":
CreateProcess
 error=2, The system cannot find the file specified
 [property]     at java.lang.ProcessBuilder.start(Unknown Source)
 [property]     at java.lang.Runtime.exec(Unknown Source)
 [property]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 [property]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 [property]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Sourc
e)
 [property]     at java.lang.reflect.Method.invoke(Unknown Source)
 [property]     at
org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.e
xec(Execute.java:646)
 [property]     at
org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:416

Here's a simple ant project that duplicates the problem:

<project name="test" default="getenv" basedir=".">

    <target name="getenv">
        <property environment="env" />

    </target>

</project>

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50542] Getting java.io.IOException when trying to use property environment

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50542

--- Comment #3 from Stefan Bodewig <bo...@apache.org> 2011-01-05 10:53:39 EST ---
If I'm correct and it really is a duplicate of bug 16611 then you are running
on
a Windows version that is newer than XP or 2003 (the latest versions known to
Ant
1.5.2) and Ant thinks it is a win9x system.

A workaround would be to set the os.name system property to something
recognized
as "Windows with cmd.exe rather than command.com" by Ant.  "windows 2000"
should
work.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50542] Getting java.io.IOException when trying to use property environment

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50542

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE
         OS/Version|                            |All

--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2011-01-05 03:53:30 EST ---
If you really are using 1.5.2 then please note that it is veeery old.  It has
been released almost eight years ago and we've had thriteen releases
after that.

It seems you are hitting bug 16611 which has been fixed for Ant 1.6 seven
years ago.

*** This bug has been marked as a duplicate of bug 16611 ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50542] Getting java.io.IOException when trying to use property environment

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50542

--- Comment #2 from t3knoid@yahoo.com 2011-01-05 09:45:49 EST ---
Thanks for the info.  I figured it was already fixed.  My problem is that the
system I am working with has ant pre-installed and upgrading is not an option. 
Anyway, I will read the bug 16611 for any workarounds.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.