Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

Re: [groovy-user] Very simple script failing when run from jar --
 problem with DGM loading

Roshan Dawrani

2010-03-18

Replies: Find Java Web Hosting

Author LoginPost Reply

On Thu, Mar 18, 2010 at 11:16 PM, <polinastya-groovy@yahoo.com> wrote:
Apparently, the class loader is null when the script is loaded from a java command line.  It does not matter whether the JVM is 1.5 or 1.6. 

Also, the classloader is not null because the script is loaded from a java command, it is null because the groovy class is loaded by the bootstrap class loader (because u use -Xbootclasspath/a:lib\groovy-all-1.7.1.jar). Here is the relevant javadoc of Class#getClassLoader() -

    /**
     * Returns the class loader for the class.  Some implementations may use
     * null to represent the bootstrap class loader. This method will return
     * null in such implementations if this class was loaded by the bootstrap
     * class loader.
     */

©2008 gg3721.com - Jax Systems, LLC, U.S.A.