Forum Discussion
nmrao
13 years agoCommunity Hero
In groovy scripts, when required to use separator
And some times need to call external java programs where it can have classpath with multiple jar files the following piece of groovy can be used
for eg, there are two libraries needs to be included
def SEP=java.io.File.separator
And some times need to call external java programs where it can have classpath with multiple jar files the following piece of groovy can be used
def colon = null
if (System.properties['os.name'].toLowerCase().contains('windows')) {
colon = ';'
} else {
colon = ':'
}
for eg, there are two libraries needs to be included
def USER_CLASSPATH=<somepath>+SEP+library1.jar+colon+<somepath>+SEP+library2.jar