[groovy-user] Problems installing Groovy 1.5.4

9 views
Skip to first unread message

Peter Herth

unread,
Mar 3, 2008, 3:49:37 AM3/3/08
to us...@groovy.codehaus.org
Hi,


following the installation instructions I had no problems installing
groovy 1.0 on a Mac, a linux and a solaris machine. However, when I
try to run groovysh on a 1.5.4 installation, I get exceptions on all
mentioned systems.

My settings are (and work, if I replace 1.5.4 with 1.0):

export GROOVY_HOME=/Users/herth/Documents/groovy-1.5.4/
export PATH=$PATH:${GROOVY_HOME}bin
export JAVA_HOME=/Library/Java/Home

and the same (but of course with different paths) on the Linux machine, using
JDK 1.5 and JDK 1.6 respectively.
But trying to run groovysh, I get both on the Mac and the Linux machine:

java.lang.NoClassDefFoundError: org/objectweb/asm/Opcodes
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at org.codehaus.groovy.reflection.CachedClass$1.run(CachedClass.java:149)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:146)
at groovy.lang.MetaClassImpl.addInterfaceMethods(MetaClassImpl.java:291)
at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:213)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2469)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:185)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:145)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:27)
at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:46)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNewN(ScriptBytecodeAdapter.java:227)
at org.codehaus.groovy.tools.shell.Main.<clinit>(Main.groovy:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:101)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)

On my mac, groovy -e "println 'hallo'" runs, but on Linux I get the
following error:

java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getMethod0(Class.java:2670)
at java.lang.Class.getMethod(Class.java:1603)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:92)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)


anything I am missing?

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Guillaume Laforge

unread,
Mar 3, 2008, 4:07:42 AM3/3/08
to us...@groovy.codehaus.org
What does your CLASSPATH variable contain?

--
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

Peter Herth

unread,
Mar 3, 2008, 4:19:22 AM3/3/08
to us...@groovy.codehaus.org
The CLASSPATH variable is not set - as to the installing instructions on:

http://groovy.codehaus.org/Installing+Groovy

(The same setup for 1.0 worked without setting any classpath)

Guillaume Laforge

unread,
Mar 3, 2008, 4:21:30 AM3/3/08
to us...@groovy.codehaus.org
Ok, good.
And when upgrading, did you just unzip the new version of Groovy on
the old GROOVY_HOME location?
Could you please list the jars present in your GROOVY_HOME/lib directory?

--

Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------

Peter Herth

unread,
Mar 3, 2008, 5:09:30 AM3/3/08
to us...@groovy.codehaus.org
On Mon, Mar 3, 2008 at 10:21 AM, Guillaume Laforge <glaf...@gmail.com> wrote:
> Ok, good.
> And when upgrading, did you just unzip the new version of Groovy on
> the old GROOVY_HOME location?
> Could you please list the jars present in your GROOVY_HOME/lib directory?
>

I unzipped groovy-1.5.4 into a separate directory of its own.

My GROOVY_HOME looks like:

groovy-1.5.4 132>ll
total 36
4 drwxr-xr-x 6 herth vcad 4096 Feb 1 18:54 ./
4 drwxrws--- 4 herth vcad 4096 Feb 5 17:40 ../
4 -rw-r--r-- 1 herth mail 1728 Feb 1 18:53 ASM-LICENSE.txt
4 -rw-r--r-- 1 herth mail 582 Feb 1 18:53 LICENSE.txt
4 -rw-r--r-- 1 herth mail 647 Feb 1 18:53 NOTICE.txt
4 drwxr-xr-x 2 herth mail 4096 Feb 1 18:53 bin/
4 drwxr-xr-x 2 herth mail 4096 Feb 1 18:53 conf/
4 drwxr-xr-x 2 herth mail 4096 Feb 1 18:53 embeddable/
4 drwxr-xr-x 2 herth mail 4096 Feb 1 18:53 lib/

its lib directory:


groovy-1.5.4 133>ll lib
total 5592
4 drwxr-xr-x 2 herth mail 4096 Feb 1 18:53 ./
4 drwxr-xr-x 6 herth vcad 4096 Feb 1 18:54 ../
1264 -rw-r--r-- 1 herth mail 1289806 Feb 1 18:53 ant-1.7.0.jar
96 -rw-r--r-- 1 herth mail 92792 Feb 1 18:53 ant-junit-1.7.0.jar
12 -rw-r--r-- 1 herth mail 11734 Feb 1 18:53
ant-launcher-1.7.0.jar
440 -rw-r--r-- 1 herth mail 443432 Feb 1 18:53 antlr-2.7.6.jar
36 -rw-r--r-- 1 herth mail 34778 Feb 1 18:53 asm-2.2.jar
20 -rw-r--r-- 1 herth mail 17806 Feb 1 18:53
asm-analysis-2.2.jar
16 -rw-r--r-- 1 herth mail 16262 Feb 1 18:53 asm-tree-2.2.jar
36 -rw-r--r-- 1 herth mail 32860 Feb 1 18:53 asm-util-2.2.jar
116 -rw-r--r-- 1 herth mail 113369 Feb 1 18:53 bsf-2.4.0.jar
32 -rw-r--r-- 1 herth mail 30117 Feb 1 18:53 commons-cli-1.0.jar
52 -rw-r--r-- 1 herth mail 52915 Feb 1 18:53
commons-logging-1.1.jar
2236 -rw-r--r-- 1 herth mail 2282731 Feb 1 18:53 groovy-1.5.4.jar
92 -rw-r--r-- 1 herth mail 87325 Feb 1 18:53 jline-0.9.93.jar
52 -rw-r--r-- 1 herth mail 50493 Feb 1 18:53 jsp-api-2.0.jar
124 -rw-r--r-- 1 herth mail 120640 Feb 1 18:53 junit-3.8.2.jar
56 -rw-r--r-- 1 herth mail 56164 Feb 1 18:53
mockobjects-core-0.09.jar
404 -rw-r--r-- 1 herth mail 409467 Feb 1 18:53 mx4j-3.0.2.jar
100 -rw-r--r-- 1 herth mail 97693 Feb 1 18:53 servlet-api-2.4.jar
28 -rw-r--r-- 1 herth mail 24677 Feb 1 18:53
xpp3_min-1.1.3.4.O.jar
372 -rw-r--r-- 1 herth mail 373194 Feb 1 18:53 xstream-1.2.2.jar

Guillaume Laforge

unread,
Mar 3, 2008, 5:21:59 AM3/3/08
to us...@groovy.codehaus.org
Things seem to look fine.
Hmm, I'm perplexed, to say the least.

Do you have anything in your home's .groovy/lib folder?

--

Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------

Paul King

unread,
Mar 3, 2008, 5:29:34 AM3/3/08
to us...@groovy.codehaus.org

What does PATH contain prior to adding in $GROOVY_HOME/bin?

Peter Herth

unread,
Mar 3, 2008, 5:57:25 AM3/3/08
to us...@groovy.codehaus.org
On Mon, Mar 3, 2008 at 11:21 AM, Guillaume Laforge <glaf...@gmail.com> wrote:
> Things seem to look fine.
> Hmm, I'm perplexed, to say the least.

Glad you agree :)

>
> Do you have anything in your home's .groovy/lib folder?
>

I even don't have a .groovy/lib folder...
I am currently testing on my workplace linux machine, will test on my
Mac at home later...

Answering Pauls mail:
my path contains the groov/1.5.4/bin then jdk1.6.0/bin and then some
system paths like /user/bin, but nothing groovy-related.

Guillaume Laforge

unread,
Mar 3, 2008, 6:01:52 AM3/3/08
to us...@groovy.codehaus.org
And you don't have any problem with any other Java applications?

--

Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------

Peter Herth

unread,
Mar 3, 2008, 6:40:35 AM3/3/08
to us...@groovy.codehaus.org
On Mon, Mar 3, 2008 at 12:01 PM, Guillaume Laforge <glaf...@gmail.com> wrote:
> And you don't have any problem with any other Java applications?

None. What surprises me most, that I get exactly the same error on my
Mac as on my linux system. So its certainly not only one strange
machine... I have another linux machine, I will try to install it
there lateron too and report the outcomings...

Guillaume Laforge

unread,
Mar 3, 2008, 7:18:11 AM3/3/08
to us...@groovy.codehaus.org
Yeah, it's weird, we haven't come up with such issues so far.
At least, the debugging questions usually helped us find what was going wrong.

--

Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------

Jochen Theodorou

unread,
Mar 3, 2008, 9:08:45 AM3/3/08
to us...@groovy.codehaus.org
Peter Herth schrieb:

> Hi,
>
>
> following the installation instructions I had no problems installing
> groovy 1.0 on a Mac, a linux and a solaris machine. However, when I
> try to run groovysh on a 1.5.4 installation, I get exceptions on all
> mentioned systems.
>
> My settings are (and work, if I replace 1.5.4 with 1.0):
>
> export GROOVY_HOME=/Users/herth/Documents/groovy-1.5.4/
> export PATH=$PATH:${GROOVY_HOME}bin
> export JAVA_HOME=/Library/Java/Home

there are some things you could try... first... remove "/" at the end of
GROOVY_HOME and test if this helped. Next you remove groovy from PATH
and try executing it to be sure there is no other Groovy present in your
system. Next you could get into the bin folder of your Groovy
installation and try to start Groovy from there with your PATH still not
containing the Groovy script... for example ./groovysh

> and the same (but of course with different paths) on the Linux machine, using
> JDK 1.5 and JDK 1.6 respectively.
> But trying to run groovysh, I get both on the Mac and the Linux machine:
>
> java.lang.NoClassDefFoundError: org/objectweb/asm/Opcodes
> at java.lang.ClassLoader.defineClass1(Native Method)

[...]


> at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:101)
> at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)

probably the RootLoader failed to load the lib folder... probably
because of the trailing slash... not sure if this is the reason.

bye blackdrag
--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
http://www.g2one.com/

Peter Herth

unread,
Mar 3, 2008, 10:23:29 AM3/3/08
to us...@groovy.codehaus.org
On Mon, Mar 3, 2008 at 3:08 PM, Jochen Theodorou <blac...@gmx.org> wrote:
> Peter Herth schrieb:

> > My settings are (and work, if I replace 1.5.4 with 1.0):
> >
> > export GROOVY_HOME=/Users/herth/Documents/groovy-1.5.4/
> > export PATH=$PATH:${GROOVY_HOME}bin
> > export JAVA_HOME=/Library/Java/Home
>
> there are some things you could try... first... remove "/" at the end of
> GROOVY_HOME and test if this helped. Next you remove groovy from PATH
> and try executing it to be sure there is no other Groovy present in your
> system. Next you could get into the bin folder of your Groovy
> installation and try to start Groovy from there with your PATH still not
> containing the Groovy script... for example ./groovysh

Bingo! once I removed the trailing slash from HOME, and put it into
the path, it works
perfectly (at least on my Linux box, will test more systems now).

Many thanks,

Peter

Reply all
Reply to author
Forward
0 new messages