Jenkins报错Caused: java.io.IOException: Cannot run program "sh" (in directory "D:\Jenkins\Jenkins_home\workspace\jmeter_test"): CreateProcess error=2, 系统找不到指定的文件。
想在本地执行我的python文件,我本地搭建了一个Jenkins,使用了execute shell来运行我的脚本,发现报错
[jmeter_test] $ sh -xe D:\tomcat\apache-tomcat-8.5.20\temp\jenkins4583980269774421650.sh
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: CreateProcess error=2, 系统找不到指定的文件。
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
Caused: java.io.IOException: Cannot run program "sh" (in directory "D:\Jenkins\Jenkins_home\workspace\jmeter_test"): CreateProcess error=2, 系统找不到指定的文件。
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:249)
at hudson.Proc$LocalProc.<init>(Proc.java:218)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
at hudson.Launcher$ProcStarter.start(Launcher.java:450)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
at hudson.model.Run.execute(Run.java:1737)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:419)
解决办法:
windows的服务器执行文件,python文件或者其他,需要使用execute windows batch commend 。liunx 下使用execute shell

Jenkins报错Caused: java.io.IOException: Cannot run program "sh" (in directory "D:\Jenkins\Jenkins_home\workspace\jmeter_test"): CreateProcess error=2, 系统找不到指定的文件。的更多相关文章
- java调用Linux命令报错:java.io.IOException: Cannot run program "ps": CreateProcess error=2, ?????????
在idea里面,java代码:Runtime.getRuntime().exec("ps -aux") 是因为默认是用windows平台运行了,所以报错,得改成调用Linux平台运 ...
- 解决java.io.IOException: Cannot run program "cygpath": CreateProcess error=2, 系统找不到指定的文件 的错误
一.外部环境: 系统环境:Windows 8 磁盘分区:只有C盘 开发环境:IntelliJ IDEA Community Edition 2016.1.3(64) 执行代码:rdd.saveAsTe ...
- IDEA 安装完码云插件,运行报“Cannot run program "xxx":CreateProcess error=2,系统找不到指定的文件”
错误:Cannot run program "E:\Program Files\Git\bin\git.exe":CreateProcess error=2,系统找不到指定的文件 ...
- Jmeter常见报错信息: ERROR - jmeter.protocol.http.proxy.ProxyControl: Could not initialise key store java.io.IOException: Cannot run program "keytool"
JMeter 2.10 用的新方法来录制HTTPS请求Java 7. 录制的过程中会碰到一些问题或者报错,就目前碰到的,做出一些总结. ERROR - jmeter.protocol.http.pro ...
- 解决方案--java执行cmd命令ProcessBuilder--出错Exception in thread "main" java.io.IOException: Cannot run program "dir d:\": CreateProcess error=2(xjl456852原创)
当我尝试在java中通过ProcessBuilder运行window的cmd命令时出现错误: public static void main(String [] args) throws IOExce ...
- hudson运行出现java.io.IOException Cannot run program的错误分析
作者:朱金灿 来源:http://blog.csdn.net/clever101 在昨天运行每日构建时hudson突然出错,错误信息如下: [MySoft3.1] $ cmd /c call &quo ...
- 控制台(Console)报错:java.io.IOException: Broken pipe
控制台(Console)输出: java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcherImpl.write0(Native Meth ...
- 运行报错:java.io.IOException: invalid constant type: 15
jdk,tomcat更新到jdk1.8与 tomcat8 运行报错:java.io.IOException: invalid constant type: 15 pom.xml文件中更新javassi ...
- 安装spark 报错:java.io.IOException: Could not locate executable E:\hadoop-2.7.7\bin\winutils.exe
打开 cmd 输入 spark-shell 虽然可以正常出现 spark 的标志符,但是报错:java.io.IOException: Could not locate executable E:\h ...
随机推荐
- zato server启动后自动关闭问题解决
症状 zato start server 启动server后,过一会server自动关闭了 解决 查看日志 UnicodeDecodeError: 'ascii' codec can't decode ...
- 原创:微信小程序亲测体验,公众号入口曝光!
扫描即可体验知乐微信小程序,并且看到入口 你可以在这里看到相应的小程序:微信小程序商店 发现内有历史列表入口 真实小程序 搜索 操作栏 放置到桌面示意图必须搜索全称,才可以搜索到小程序 推荐给朋友,可 ...
- Jquery UI Dialog 导致C#页面后台事件失效
$(function () { dialog = $("#dialog-form").dialog({ autoOpen: false, height: 450, width: 5 ...
- gradle 构建的 Spring Boot 使用 logback
文章讲的是配置和使用,入门请看文档先. what 目的: 可以实现log不同级别的日志记录,例如info 在一个文件夹内,另一个级别的在另一个文件夹内. how 配置依赖项 //log ...
- [javaEE] 开源数据库连接池
一些开源组织提供了数据源的独立实现: DBCP数据库连接池 C3P0数据库连接池 Apache Tomcat内置的连接池 DBCP连接池 apache提供的连接池实现,需要导入common-dbcp. ...
- curl POST JSON
1. 场景 Controller接收json格式数据 封装bean @RequestMapping(value = "/bb", method = RequestMethod.PO ...
- [算法练习]Two Sum
题目说明: Given an array of integers, return indices of the two numbers such that they add up to a speci ...
- 基于以太坊的Token开发步骤
Token开发步骤 一.准备工具1.安装以太坊brew tap ethereum/ethereumbrew install ethereum2.node:brew install nodejs3.安装 ...
- 用两个栈实现队列(C++ 和 Python 实现)
(说明:本博客中的题目.题目详细说明及参考代码均摘自 “何海涛<剑指Offer:名企面试官精讲典型编程题>2012年”) 题目 用两个栈实现一个队列.队列的声明如下,请实现它的两个函数 a ...
- 修改虚拟机ip备份
修改虚拟机ip 因为别人写的很好,在此备份一下.