在cygwin上手动执行脚本可以运行,但不能远程运行

问题描述

我正在尝试弄清楚到底是什么问题,下面是我正在尝试的步骤:

  1. 在Windows 2019上,直接从cygwin终端安装cygwin64,执行下面的“ configure”脚本效果很好,以下是configure命令:
 bash configure --with-freetype=bundled --with-tools-dir=/cygdrive/c/progra~2/micros~1/2017/Enterprise/VC/Tools/ --with-boot-jdk=/cygdrive/c/jdk-10.0.2/ --with-jtreg=/cygdrive/c/jtreg-5.1-b01/ --with-version-pre=sncmid --with-version-build=$build --with-version-opt= 
  1. 但是,当我使用将在Windows从属节点上执行的jenkins进行自动化操作时,以下操作会失败
configure: Found potential Boot JDK using configure arguments
configure: Potential Boot JDK found at /cygdrive/c/jdk-10.0.2/ is incorrect JDK version (Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8); ignoring
configure: (Your Boot JDK version must be one of: 10 11)
configure: error: The path given by --with-boot-jdk does not contain a valid Boot JDK

configure exiting with result code 1

想知道为什么在“ cygwin上直接执行可以正常工作”和我使用“ c:\cygwin64\bin\bash.exe -l script.sh调用的”来自jenkins job”之间的区别的原因,这个script.sh执行配置脚本。

脚本调用

c:\cygwin64\bin\bash.exe -l '%WORKSPACE%\script.sh' %BUILD_NUMBER% /cygdrive/c/openjdk11windows 

script.sh的内容

#!/bin/bash 
echo $1 
build=$1 
source ~/.bash_profile 
source ~/.bashrc 
bash configure --with-freetype=bundled --with-tools-dir=/cygdrive/c/progra~2/micros~1/2017/Enterprise/VC/Tools/ --with-boot-jdk=/cygdrive/c/jdk-10.0.2/ --with-jtreg=/cygdrive/c/jtreg-5.1-b01/ --with-version-pre=sncmid --with-version-build=$build --with-version-opt=

如果有人对此有想法,请分享

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)