Forum Discussion

nmrao's avatar
nmrao
Community Hero
13 years ago

Incorrect location for SOAPUI_HOME in soapui.bat

Not sure, if any of you come accorss this problem.

1. Environment variable SOAPUI_HOME is defined, say c:\tools\smartbear\soapui4.5.1.
2. In the soapui project, there is a groovy script as a test step which calls a java program.
3. It will evaluate SOAPUI_HOME from

def env = System.getenv()
def soapuiHome = env['SOAPUI_HOME']

and that will be included in classpath as soapuiHome+'\bin\*'.

4. When test is run, it is being identified as c:\tools\smartbear\soapui4.5.1\bin\bin\* in classpath.

It took time for me to locate the problem as the same classpath on unix is working fine.
If you have noticed there is an additional bin in classpath while calling java program.

Then started looking at environment if there is any issue, could not found any thing.
At the end, noticed the following in %SOAPUI_HOME%\bin\soapui.bat which is causing this issue.


@echo off
set SOAPUI_HOME=%~dp0
set JAVA=%JAVA_HOME%\bin\java
if not "%JAVA_HOME%" == "" goto SET_CLASSPATH
set JAVA=java
echo JAVA_HOME is not set, unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
:SET_CLASSPATH
rem init classpath
set CLASSPATH=%SOAPUI_HOME%soapui-4.5.1.jar;%SOAPUI_HOME%..\lib\*;


If you stare at line number two, where the problem is. It is overwriting users SOAPUI_HOME envronment variable to current directory which SOAPUI_HOME\bin. I believe, this is a defect.

If you look at soapui.sh, it will not set like this and that is the reason there is no issue when i run the java program in the groovy step.

The soapui.bat has been in the same way in soapui 4.5.1, 4.0 version at least, do not know about other versions. Hope Smart Bear team can take care of this.

2 Replies

  • SiKing's avatar
    SiKing
    Community Expert
    I personally have found multiple problems with the .bat and .sh startup files in SoapUI.
    The workaround for the problem you describe is that I personally use "SOAPUI_ROOT" as the reference in my environment.