Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2548

-cp include in bash script startGroovy do not include all needed jars

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.1
    • 1.5.6, 1.6-beta-1
    • None
    • None
    • Linux 32b (openSuse 10.3)
      Mac OS X 10.4.11
    • Patch

    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=result ":" PRE $0}

      + END

      { print result}

      ')

      1. Create the final classpath. Setting a classpath using the -cp or -classpath option means not to use the
      2. global classpath. Groovy behaves then the same as the java interpreter
        thidney@deepblue:~/Desktop>

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            paulk Paul King
            thidney thidney
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment