Shibankar
Shibankar

Reputation: 21

Error in Groovy installation

I have install Groovy 2.1.1 in my unix box. While executing groovysh getting the below error.

Exception in thread "main" java.lang.NoClassDefFoundError: error:
Caused by: java.lang.ClassNotFoundException: error:
    at java.net.URLClassLoader.findClass(URLClassLoader.java:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:346)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
Could not find the main class: error:.  Program will exit.

What could be the possible root cause for this error...???

Upvotes: 2

Views: 1235

Answers (3)

Satya Kaveti
Satya Kaveti

Reputation: 354

Download Groovy Binary From http://groovy.codehaus.org/Download

Download zip: Binary Release

Extract Local Disk say D;\GROOVY\ groovy-2.3.9

It contains the Folder Structure D:. ├───bin ├───conf ├───embeddable ├───indy ├───lib └───META-INF

Go to Control Panel\User Accounts\User Accounts  Change My Environment Variables

Set/new GROOVY_HOME = D:\GROOVY\groovy-2.3.9 (don’t put : semicolon)

Set PATH = C:\Program Files\Java\jdk1.8.0_25\bin;%GROOVY_HOME%\bin;

Add groovy-all.jar to CLASSPATH

D:\ GROOVY\ \groovy-2.3.9\embeddable\groovy-all-2.3.9.jar;.

Close and Open Command and Say –groovy

For console -groovyConsole

Upvotes: 0

Will
Will

Reputation: 14539

Since you are using IBM J9, according to the Grails FAQ, the J9 need an argument to work well with Groovy, otherwise you may get a NoClassDefFound error:

Add -Xverify:none to JVM arguments

Upvotes: 1

Aaron Digulla
Aaron Digulla

Reputation: 328724

Somewhere, you try to use the class error: (and yes, Groovy thinks that the colon is part of the class name), either in the script you execute (i.e. there must be new error: somewhere) or you wrote something like groovysh error: or you import error: (maybe indirectly)

Upvotes: 1

Related Questions