Forum Discussion
nmrao
12 years agoChampion Level 3
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
Related Content
- 4 years ago
- 4 years ago
Recent Discussions
- 15 years ago