Skip to content

Instantly share code, notes, and snippets.

@ikikko
Created October 11, 2010 04:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikikko/619968 to your computer and use it in GitHub Desktop.
Save ikikko/619968 to your computer and use it in GitHub Desktop.
g100pon #95 クラスパスの動的な変更
// g100pon #95 クラスパスの動的な変更
// 追加したいJarファイルとクラス名を指定する
def jarName = '*****.jar'
def className = '*****'
def loader = this.class.classLoader.rootLoader
loader.addURL(new File(jarName).toURL())
loader.URLs.each{ println it }
def clazz = Class.forName(className).newInstance()
println clazz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment