Forum Discussion

fixitdad's avatar
New Member
7 years ago

SOAPUI_HOME environment variable ignored on Linux

Posting here since I couldn't find a place to file a bug. I would submit a pull request, but the contributor agreement seems like to too much bother for this type of change. I don't really expect to be doing other contributions.


I'm using SoapUI-5.4.0 free edition on Centos 7.4 if anyone needs those details.


There appears to be a bug in several of the shell scripts that basically ignore the SOAPUI_HOME environment variable.

The script works if bash finds the script in the SoapUI bin directory. However, it does not work via a symbolic (or hard) link.


Here's the environment. The variable points to the installed SoapUI. There is a symbolic link to the script I'm running and the link is in the path prior to the SoapUI bin directory. (Could also leave out the SoapUI bin directory)

centos@icpclientaws ~]$ echo $SOAPUI_HOME
[centos@icpclientaws ~]$ ls $SOAPUI_HOME
JavaDoc.url RELEASENOTES.txt SmartBear License Terms of Use.txt jre licences uninstall SmartBear License Terms of bin lib soapUI.url wsi-test-tools
[centos@icpclientaws ~]$ ls -l ~/bin
total 0
lrwxrwxrwx. 1 centos centos 50 Apr 25 15:53 -> /home/centos/soapui/SoapUI-5.4.0/bin/
[centos@icpclientaws ~]$ echo $PATH

The script fails to execute:

[centos@icpclientaws ~]$
/home/centos/bin/ line 42: java: command not found
= SOAPUI_HOME = /home/centos
/home/centos/bin/ line 70: java: command not found

If I run with shell debugging enabled, You can see SOAPUI_HOME is being overwritten with /home


[centos@icpclientaws ~]$ echo $SOAPUI_HOME

[centos@icpclientaws ~]$ sh -x ++ dirname + DIRNAME=. + cygwin=false + case "`uname`" in ++ uname + '[' -d /home/centos/soapui/SoapUI-5.4.0 ']' ++ cd ./.. ++ pwd + SOAPUI_HOME=/home + export SOAPUI_HOME + '[' -f /home/jre/bin/java ']' + '[' -f /home/../../PlugIns/jre.bundle/Contents/Home/jre/bin/java ']' + JAVA=java + SOAPUI_CLASSPATH='/home/bin/soapui-5.4.0.jar:/home/lib/*' ++ java -cp '/home/bin/soapui-5.4.0.jar:/home/lib/*' /home/centos/soapui/SoapUI-5.4.0/bin/ line 42: java: command not found + JFXRTPATH= + SOAPUI_CLASSPATH=':/home/bin/soapui-5.4.0.jar:/home/lib/*' + export SOAPUI_CLASSPATH + JAVA_OPTS='-Xms128m -Xmx1024m -Dgroovy.source.encoding=iso-8859-1 -Dsoapui.home=/home/bin' + '[' /home '!=' '' ']' + JAVA_OPTS='-Xms128m -Xmx1024m -Dgroovy.source.encoding=iso-8859-1 -Dsoapui.home=/home/bin -Dsoapui.ext.libraries=/home/bin/ext' + JAVA_OPTS='-Xms128m -Xmx1024m -Dgroovy.source.encoding=iso-8859-1 -Dsoapui.home=/home/bin -Dsoapui.ext.libraries=/home/bin/ext -Dsoapui.ext.listeners=/home/bin/listeners' + JAVA_OPTS='-Xms128m -Xmx1024m -Dgroovy.source.encoding=iso-8859-1 -Dsoapui.home=/home/bin -Dsoapui.ext.libraries=/home/bin/ext -Dsoapui.ext.listeners=/home/bin/listeners -Dsoapui.ext.actions=/home/bin/actions' + export JAVA_OPTS + false + echo ================================ ================================ + echo = = + echo = SOAPUI_HOME = /home = SOAPUI_HOME = /home + echo = = + echo ================================ ================================ + java -Xms128m -Xmx1024m -Dgroovy.source.encoding=iso-8859-1 -Dsoapui.home=/home/bin -Dsoapui.ext.libraries=/home/bin/ext -Dsoapui.ext.listeners=/home/bin/listeners -Dsoapui.ext.actions=/home/bin/actions -cp ':/home/bin/soapui-5.4.0.jar:/home/lib/*' /home/centos/soapui/SoapUI-5.4.0/bin/ line 70: java: command not found

I can fix the issue by modifying the following section of the script

if [ -d $SOAPUI_HOME ]
    # get the full path (without any relative bits)
    SOAPUI_HOME=`cd $DIRNAME/..; pwd`

Just change the if condition to the following (i.e. negate the condition).

if [ ! -d $SOAPUI_HOME ]


As written, the script is testing to see if there is a directory as SOAPUI_HOME and if there is, then it overwrites the SOAPUI_HOME variable (with garbage in my case). I doubt that this is the desired behavior. If it is, then I think some explaining comment would be in order.


The following other scripts are also affected:


I would appreciate it if someone could pass this along to the development team.

1 Reply

  • nmrao's avatar
    Champion Level 3
    I remember having an issue with SOAPUI_HOME environment variable on windows platform for the mentioned scripts, so time ago. But absolutely had no issue on linux platform.

    This is little annoying. But since you already know the workaround just use the changed files and share to your team. This changes are required when you are doing certain things based on those environment variable.

    Usually, there is no defect tracking system and here is the only place for reporting issues. Hope SmartBear team have an eve on the forum and address them.

    Thanks for reporting.