How do you get the SERVERHOME path

I was unable to find a Java or Flow Service that will return the SERVERHOME directory (folder where webMethods is installed). Can someone tell me how to retrieve this info

Thx.

“Working Dir” is one of the items returned from wm.dev.util:getSystemAttributes

HTH

graham

where can i find the “wm.dev.util” classes ? is it part of the standard install for v6.0.1 ?

Hi,

Another alternative would be to use the ServerAPI.getServerConfigDir() method from the webMethods Java API.
See: <webmethodsinstalldir>/doc/API/Java/com/wm/app/b2b/server/ServerAPI.html#getServerConfigDir()

public static java.io.File getPackageConfigDir(java.lang.String pkgname)
Returns a File object representing the path name for the given package’s configuration directory. This configuration directory contains all the settings files for initializing services in that package.
Parameters:
pkgname - A String specifying the name of the package whose configuration directory is desired.
Returns:
A File object representing the path name to the SERVERHOME/packages/pkgname/config directory

Regards
Danie

just write a java service with the following code

IDataUtil.put(pipeline.getCursor(), “serverHome”, new File(System.getProperty(“user.dir”)).getCanonicalPath());

1 Like

There is a Service in the package, WmTest.test, getEnvSettings, that outputs document list of environment variables and there cooresponding paths. You can then write a service to get the path of the environment variable WM_HOME which is returned in the document list returned when running the service.
Thanks, Sue G.