16 Jul 16:04
[groovy-user] rootloader scope
From: Kallin Nagelberg <kallin.nagelberg@...>
Subject: [groovy-user] rootloader scope
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-07-16 14:08:54 GMT
Subject: [groovy-user] rootloader scope
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-07-16 14:08:54 GMT
I'm trying to write a groovy script that depends on some libraries in ../lib.
I do this:
def loader = this.class.classLoader.rootLoader
def dir = new File('../lib')
dir.eachFileMatch(~/.*\.jar$/) {
loader.addURL(it.toURL())
}
but the class I'm looking for is not found by the script.
However, when I now do an 'evaluate' of another script, that script has no problems finding classes from the libraries.
Is there a way affect the classpath of the current script?
I do this:
def loader = this.class.classLoader.rootLoader
def dir = new File('../lib')
dir.eachFileMatch(~/.*\.jar$/) {
loader.addURL(it.toURL())
}
but the class I'm looking for is not found by the script.
However, when I now do an 'evaluate' of another script, that script has no problems finding classes from the libraries.
Is there a way affect the classpath of the current script?
RSS Feed