commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siegfried Goeschl (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (EXEC-95) Program not found after setWorkingDirectory
Date Mon, 11 Jan 2016 20:32:39 GMT

    [ https://issues.apache.org/jira/browse/EXEC-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15092638#comment-15092638
] 

Siegfried Goeschl commented on EXEC-95:
---------------------------------------

Basically there are two different flavours of this issue

* The Java13CommandLauncher does not honour the the provided working directory when running
an executable and this is the launcher being used in your example
* The WinNTCommandLauncher also does not honour the the provided working directory when running
an executable

I tried to fix both of them in https://github.com/sgoeschl/commons-exec/tree/EXEC-95

> Program not found after setWorkingDirectory
> -------------------------------------------
>
>                 Key: EXEC-95
>                 URL: https://issues.apache.org/jira/browse/EXEC-95
>             Project: Commons Exec
>          Issue Type: Bug
>    Affects Versions: 1.3
>         Environment: win7 64 bit.
>            Reporter: Lorenzo Cozza
>            Assignee: Siegfried Goeschl
>
> I would like to run my script from a different folder, so I tried to use the following
line of code:
> String path = "C:/user/script/";
> CommandLine cmdLine = CommandLine.parse("myscript.cmd");
> DefaultExecutor executor = new DefaultExecutor();
> executor.setWorkingDirectory(new File(path));
> int exitValue = executor.execute(cmdLine);
> but I got an exception.
> I am using the following workaround:
> CommandLine cmdLine = CommandLine.parse(path+"/myscript.cmd");
> and it's working fine.
> The question is: are Executor and CommandLine related?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message