6

I am using groovy-2.3.3, with jdk6u35. The groovy binaries have been extracted from groovy-sdk-2.3.3.zip.

After compiling with groovyc, I got an error while running java:

Unsupported major.minor version 51.0.

I googled and figured that the problem was with the groovy-all-2.3.3-indy.jar (which is used for jdk7+), so I removed it from my CLASSPATH. Now the program works, but it gives a warning:

WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]

How to disable this warning message, since I know that it is not applicable for my setup?

If I cannot disable this warning without a recompilation from source (which is not a valid option for me), is there any other groovy executable that I should download, instead of the sdk zip file, so that it can work with java-jdk6 without any warnings?

1 Answer 1

10

Before I got

➜~  groovy -version                          
Aug 6, 2014 12:29:38 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-nio] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
Groovy Version: 2.3.4 JVM: 1.6.0_45 Vendor: Sun Microsystems Inc. OS: Linux

Editvim $JAVA_HOME/jre/lib/logging.properties

Set INFO to SEVERE or OFF java.util.logging.ConsoleHandler.level = SEVERE

After

➜~  groovy -version                          
Groovy Version: 2.3.4 JVM: 1.6.0_45 Vendor: Sun Microsystems Inc. OS: Linux

UPDATE (Second better solution):

Remove groovy-nio-2.3.6.jar from lib folder

➜  ~  groovy --version
Aug 15, 2014 11:45:56 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-nio] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
Groovy Version: 2.3.6 JVM: 1.6.0_34 Vendor: Sun Microsystems Inc. OS: Linux
➜  ~  
➜  ~  mv $GROOVY_HOME/lib/groovy-nio-2.3.6.jar $GROOVY_HOME/lib/groovy-nio-2.3.6.bak
➜  ~  
➜  ~  groovy --version                                                              
Groovy Version: 2.3.6 JVM: 1.6.0_34 Vendor: Sun Microsystems Inc. OS: Linux
4
  • Great!! Thanks. BTW, a couple of questions: (1) should the CLASSPATH be set to GROOVY_HOME/lib or embeddable? I noticed that if I set it to embeddable then I get the warning twice. What is the embeddable directory used for? (2) What did this warning about NioGroovyMethods mean?
    – R71
    Aug 8, 2014 at 4:49
  • 1
    With some research I found that indy stands for groovy with invoke dynamic support available from Java 7+ link I think you should not set classpath to lib folder as this jars are intended for groovy compiler/tools/... usage. You need Java 7+ to benefit from NioGroovyMethods moudule. See link
    – David
    Aug 10, 2014 at 20:55
  • In case anyone else is running into this problem after installing groovy with homebrew, run brew info groovy to get your GROOVY_HOME
    – David
    Sep 16, 2015 at 1:54
  • Neither method is good for me as I am trying to distribute simple groovy script and have no access neither to JAVA_HOME nor GROOVY_HOME directories on a customer's machine. Really annoying. Better choose another language. Apr 20, 2016 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.