Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.1
-
Fix Version/s: 1.5.6, 1.6-beta-1
-
Component/s: None
-
Labels:None
-
Environment:Linux 32b (openSuse 10.3)
Mac OS X 10.4.11
-
Patch Submitted:Yes
-
Number of attachments :
Description
I install & set groovy, but I always get:
> groovy
java.lang.NoClassDefFoundError: org/apache/commons/cli/CommandLineParser
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)
I looked into script and find out that it do not include all needed jar files. This diff worked for me
> diff -u /usr/bin/startGroovy.orig /usr/bin/startGroovy
— /usr/bin/startGroovy.orig 2008-01-27 22:24:09.000000000 +0100
+++ /usr/bin/startGroovy 2008-01-27 22:26:04.000000000 +0100
@@ -115,7 +115,11 @@
if [ -z "$GROOVY_CONF" ] ; then
GROOVY_CONF="$GROOVY_HOME/conf/groovy-starter.conf"
fi
-STARTER_CLASSPATH="$GROOVY_HOME/lib/groovy-1.5.1.jar"
+#STARTER_CLASSPATH="$GROOVY_HOME/lib/groovy-1.5.1.jar"
+STARTER_CLASSPATH=$(ls $GROOVY_HOME/lib | awk -v PRE="$GROOVY_HOME/lib/" '\
+ BEGIN
+
{result=result ":" PRE $0}+ END
{ print result}')
- Create the final classpath. Setting a classpath using the -cp or -classpath option means not to use the
- global classpath. Groovy behaves then the same as the java interpreter
thidney@deepblue:~/Desktop>
I think the problem is actually with your installation and not the script. The script simply bootstraps the Groovy runtime system which then loads the jars in $GROOVY_HOME/lib. The change to the script that you propose is not and should not be needed.
Clearly we need to find out why you are having this problem but this issue will almost certainly have to be marked as "Won't Fix".