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
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com
http://groovy.codehaus.org/Installing+Groovy
(The same setup for 1.0 worked without setting any classpath)
--
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com
---------------------------------------------------------------------
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
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
---------------------------------------------------------------------
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
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com
---------------------------------------------------------------------
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
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com
---------------------------------------------------------------------
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/
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