You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Backslash is discarded when interpolated in groovy string.
Environment variable JAVA_BIN="$WORKSPACE/openjdkbinary/j2sdk-image/jre/bin" ( OPENJDK_TEST="$WORKSPACE/openjdk-test") can not be set up correctly.
On Windows WORKSPACE=C:\Users\jenkins\workspace\openjdk_test_x86-64_windows $WORKSPACE is interpolated as C:Usersjenkinsworkspaceopenjdk_test_x86-64_windows.
The text was updated successfully, but these errors were encountered:
As backward slash is an escape character for groovy String include '\'
will get compiling failure : GroovyUserScript: 1: unexpected char: '\'
Replacing ${WORKSPCE} in string is to evaluate its string representation by calling it toString() method. I believe environment variables is returned at Declarative jenkins environment section with "\" discarded. Create an issue Environment variable replacement on WINDOWS discard backslashes : https://issues.jenkins-ci.org/browse/JENKINS-44482. I have searched a little bit, there is an similar but not same one issue :https://issues.jenkins-ci.org/browse/JENKINS-31144. Seem won't fix.
For now I have two choice:
Hard code environment variable for windows using slashes JAVA_BIN='C:/Users/jenkins/workspace/openjdk_test_x86-64_windows/openjdkbinary/j2sdk-image/jre/bin'
Backslash is discarded when interpolated in groovy string.
Environment variable JAVA_BIN="$WORKSPACE/openjdkbinary/j2sdk-image/jre/bin" ( OPENJDK_TEST="$WORKSPACE/openjdk-test") can not be set up correctly.
On Windows WORKSPACE=C:\Users\jenkins\workspace\openjdk_test_x86-64_windows $WORKSPACE is interpolated as C:Usersjenkinsworkspaceopenjdk_test_x86-64_windows.
The text was updated successfully, but these errors were encountered: