groovy

startGroovy error with solaris

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.2
  • Fix Version/s: 1.5.5, 1.6-beta-1
  • Component/s: groovy-jdk
  • Labels:
    None
  • Environment:
    Solaris 10 6/06 s10s_u2wos_09a SPARC
    jdk1.5.0_07 and jdk1.6.0_03
    /bash
  • Number of attachments :
    1

Description

Groovy terminates with error:
"startGroovy: syntax error at line 219: `i=$' unexpected"
under Solaris 10

groovy 1.5.1 works with the same environment variables on the same machine.

Activity

Hide
Geoff The added a comment -

The attached patch works for me in the following environment:

% uname -a
SunOS stitch 5.10 Generic_120012-14 i86pc i386 i86pc Solaris

% java -version
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)

Show
Geoff The added a comment - The attached patch works for me in the following environment: % uname -a SunOS stitch 5.10 Generic_120012-14 i86pc i386 i86pc Solaris % java -version java version "1.5.0_14" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03) Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)
Hide
Geoff The added a comment -

Patch to slightly de-bashify startGroovy to allow it to run under Solaris 10.

Show
Geoff The added a comment - Patch to slightly de-bashify startGroovy to allow it to run under Solaris 10.
Hide
Paul King added a comment - - edited

Thanks for the patch!

Applied and tested on:

  • SunOS 5.10 (checked it appeared to fix this)
  • Cygwin (1.5.25) (checked it didn't appear to break this)
  • Ubuntu (2.6.22-14 kernel) (checked it didn't appear to break this)
Show
Paul King added a comment - - edited Thanks for the patch! Applied and tested on:
  • SunOS 5.10 (checked it appeared to fix this)
  • Cygwin (1.5.25) (checked it didn't appear to break this)
  • Ubuntu (2.6.22-14 kernel) (checked it didn't appear to break this)
Hide
Brenden Maher added a comment -

Hi I am trying to get groovy to run on Solaris 10.4 on an x86 box. I downloaded the patch - startGroovyatch renamed it to startGroovy. I start a bash shell /usr/bin/bash run ./groovy -version and get
./groovy: syntax error at line 3: `(' unexpected ...... am I suposed to do anything else to this file to get it to work???

uname -
SunOS neo 5.10 Generic_127112-07 i86pc i386 i86pc
java version 1.6.0_04-b12

Thanks,
bcm

Show
Brenden Maher added a comment - Hi I am trying to get groovy to run on Solaris 10.4 on an x86 box. I downloaded the patch - startGroovyatch renamed it to startGroovy. I start a bash shell /usr/bin/bash run ./groovy -version and get ./groovy: syntax error at line 3: `(' unexpected ...... am I suposed to do anything else to this file to get it to work??? uname - SunOS neo 5.10 Generic_127112-07 i86pc i386 i86pc java version 1.6.0_04-b12 Thanks, bcm
Hide
Russel Winder added a comment -

Brenden,

It is not a question of downloading the patch and renaming it, it is a question of applying the patch to an installed startGroovy that needs the patch applying, i.e. the patch is an edit specification not a replacement file.

I suggest you download a copy of startGroovy from the Subversion repository and install it, this will have the patch applied and should work fine.

Show
Russel Winder added a comment - Brenden, It is not a question of downloading the patch and renaming it, it is a question of applying the patch to an installed startGroovy that needs the patch applying, i.e. the patch is an edit specification not a replacement file. I suggest you download a copy of startGroovy from the Subversion repository and install it, this will have the patch applied and should work fine.
Hide
Brenden Maher added a comment -

Thanks Russel,

3 Questions-

I went to the https repository and found /trunk/groovy/groovy-core/src/bin
startGroovy..... isn't that the same as the startGroovy.patch above??

What do you mean install it- just copy it in the the bin dir?

I tried "installing" the startGroovy.patch(from this page) by executing it in the bin dir with the origional startGroovy and that had a command not found on line 1..... sorry but my bash scripting is about nill.....

Thanks for your help!
-Brenden

Show
Brenden Maher added a comment - Thanks Russel, 3 Questions- I went to the https repository and found /trunk/groovy/groovy-core/src/bin startGroovy..... isn't that the same as the startGroovy.patch above?? What do you mean install it- just copy it in the the bin dir? I tried "installing" the startGroovy.patch(from this page) by executing it in the bin dir with the origional startGroovy and that had a command not found on line 1..... sorry but my bash scripting is about nill..... Thanks for your help! -Brenden
Hide
Paul King added a comment -

The patch above isn't the same as the file in the repository. You can make use of the supplied patch if you know how to run the patch program. Installing in general might require copying and chmod'ing though in this case I think just copying should be all you need.

Show
Paul King added a comment - The patch above isn't the same as the file in the repository. You can make use of the supplied patch if you know how to run the patch program. Installing in general might require copying and chmod'ing though in this case I think just copying should be all you need.
Hide
Brenden Maher added a comment -

Hi,

I think I am making lots of progress.... I no longer get the error at line 219 or line 3!!

I downloaded the startGroovy file from Subversion, copied it in an ran it ....

Now I get groovy -version
NoClassDefFoundError : org/codehaus/groovy/tools/GroovyStarter

I downloaded the groovy-1.5.4 binary zip version from-
http://groovy.codehaus.org/Download ??

Any Thoughts??
Thanks Again,
-Brenden

Show
Brenden Maher added a comment - Hi, I think I am making lots of progress.... I no longer get the error at line 219 or line 3!! I downloaded the startGroovy file from Subversion, copied it in an ran it .... Now I get groovy -version NoClassDefFoundError : org/codehaus/groovy/tools/GroovyStarter I downloaded the groovy-1.5.4 binary zip version from- http://groovy.codehaus.org/Download ?? Any Thoughts?? Thanks Again, -Brenden
Hide
Paul King added a comment -

It looks like you don't have GROOVY_HOME set up. Did you follow the install instructions:

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

Show
Paul King added a comment - It looks like you don't have GROOVY_HOME set up. Did you follow the install instructions: http://groovy.codehaus.org/Installing+Groovy
Hide
Brenden Maher added a comment -

HI,

Sorry for the delay I was out....

Yes, The first thing I did was the install instructions.... Below is my environment and setup etc....

Thanks
-Brenden.

$ echo $SHELL
/bin/sh
$ which bash
/usr/bin/bash
$ bash
Thu Mar 27 09:23:29 EDT 2008
brenden
Thu Mar 27 09:24:14 EDT 2008
brenden
neo: slkdfjsljfaslkslkfj
bash: slkdfjsljfaslkslkfj: command not found
neo: cat .bash_profile
#

  1. Copyright (c) 2001 by Sun Microsystems, Inc.
  2. All rights reserved.
    #
  3. ident "@(#)local.profile 1.10 01/06/23 SMI"
    stty istrip
    SHELL=/usr/bin/bash
    PS1="`hostname`: "
    JAVA_HOME=/usr/jdk/latest
    GROOVY_HOME=/opt/groovy/groovy-1.5.4
    PATH=$JAVA_HOME/bin:/usr/openwin/bin:/usr/bin:/usr/ucb:/etc:$GROOVY_HOME/bin:.
    export JAVA_HOME GROOVY_HOME PATH
    date
    /usr/ucb/whoami
    #who | wc -1
    neo: echo $SHELL
    /usr/bin/bash
    neo: echo $GROOVY_HOME
    /opt/groovy/groovy-1.5.4
    neo: echo $PATH
    /usr/jdk/latest/bin:/usr/openwin/bin:/usr/bin:/usr/ucb:/etc:/opt/groovy/groovy-1.5.4/bin:.
    neo: echo $JAVA_HOME
    /usr/jdk/latest
    neo: jave -version
    bash: jave: command not found
    neo: java -version
    java version "1.6.0_04"
    Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
    Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)
    neo: groovy -version
    Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/tools/GroovyStarter
    Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.tools.GroovyStarter
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    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.Launcheneo: cd $GROOVY_HOME
    neo: pwd
    /opt/groovy/groovy-1.5.4
    neo: cd bin
    neo: more startGroovy
  4. mode:sh

##############################################################################

    1. ##
    2. Groovy JVM Bootstrap for UN*X ##
    3. ##
      ##############################################################################

##

    1. $Revision$
    2. $Date$
      ##

PROGNAME=`basename "$0"`

#DIRNAME=`dirname "$0"`

SCRIPT_PATH="$0"

etc........

It looks like $GROOVY_HOME is not getting expanded as in:
at sun.misc.Launcheneo: cd $GROOVY_HOME

shouldn't the $GROOVY_HOME be expanded at this point???
Why wouldn't this be so??
is this the problem??

-Thanks
-Brenden.

Show
Brenden Maher added a comment - HI, Sorry for the delay I was out.... Yes, The first thing I did was the install instructions.... Below is my environment and setup etc.... Thanks -Brenden. $ echo $SHELL /bin/sh $ which bash /usr/bin/bash $ bash Thu Mar 27 09:23:29 EDT 2008 brenden Thu Mar 27 09:24:14 EDT 2008 brenden neo: slkdfjsljfaslkslkfj bash: slkdfjsljfaslkslkfj: command not found neo: cat .bash_profile #
  1. Copyright (c) 2001 by Sun Microsystems, Inc.
  2. All rights reserved. #
  3. ident "@(#)local.profile 1.10 01/06/23 SMI" stty istrip SHELL=/usr/bin/bash PS1="`hostname`: " JAVA_HOME=/usr/jdk/latest GROOVY_HOME=/opt/groovy/groovy-1.5.4 PATH=$JAVA_HOME/bin:/usr/openwin/bin:/usr/bin:/usr/ucb:/etc:$GROOVY_HOME/bin:. export JAVA_HOME GROOVY_HOME PATH date /usr/ucb/whoami #who | wc -1 neo: echo $SHELL /usr/bin/bash neo: echo $GROOVY_HOME /opt/groovy/groovy-1.5.4 neo: echo $PATH /usr/jdk/latest/bin:/usr/openwin/bin:/usr/bin:/usr/ucb:/etc:/opt/groovy/groovy-1.5.4/bin:. neo: echo $JAVA_HOME /usr/jdk/latest neo: jave -version bash: jave: command not found neo: java -version java version "1.6.0_04" Java(TM) SE Runtime Environment (build 1.6.0_04-b12) Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode) neo: groovy -version Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/tools/GroovyStarter Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.tools.GroovyStarter at java.net.URLClassLoader$1.run(URLClassLoader.java:200) 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.Launcheneo: cd $GROOVY_HOME neo: pwd /opt/groovy/groovy-1.5.4 neo: cd bin neo: more startGroovy
  4. mode:sh
##############################################################################
    1. ##
    2. Groovy JVM Bootstrap for UN*X ##
    3. ## ##############################################################################
##
    1. $Revision$
    2. $Date$ ##
PROGNAME=`basename "$0"` #DIRNAME=`dirname "$0"` SCRIPT_PATH="$0" etc........ It looks like $GROOVY_HOME is not getting expanded as in: at sun.misc.Launcheneo: cd $GROOVY_HOME shouldn't the $GROOVY_HOME be expanded at this point??? Why wouldn't this be so?? is this the problem?? -Thanks -Brenden.
Hide
Brenden Maher added a comment -

Hi,

I have really been pulling my hair out trying to get this to work so any help would be great!!!
BTW I have a got a groovy version running on OSX but I need to get it running on solaris.
I modified the startGroovy script like so-
(output is at the bottom)

startGroovy ( ) {
CLASS=$1
shift

  1. Start the Profiler or the JVM
    if $useprofiler ; then
    runProfiler
    else
    echo Starter Class Path is $STARTER_CLASSPATH
    GROOVYJAR=/export/groovytmp/groovy-1.5.4/lib/groovy-1.5.4.jar
    export GROOVYJAR
    echo Groovy Jar is $GROOVYJAR
    echo Java Opts are $JAVA_OPTS
    SCRIPT_PATH=$GROOVY_HOME/bin/groovy
    export SCRIPT_PATH
    echo Script Path is $SCRIPT_PATH
    echo GROOVY CONFIG IS $GROOVY_CONF
    echo TOOLS_JAR is $TOOLS_JAR
    echo Groovy Home is $GROOVY_HOME
    echo STARTER_MAIN_CLASS is $STARTER_MAIN_CLASS
    echo CLASS is $CLASS
    echo CP is $CP
    echo @ is $@
    exec "$JAVACMD" $JAVA_OPTS \
    -classpath "$STARTER_CLASSPATH" \
    -Dscript.name="$SCRIPT_PATH" \
    -Dprogram.name="$PROGNAME" \
    -Dgroovy.starter.conf="$GROOVY_CONF" \
    -Dgroovy.home="$GROOVY_HOME" \
    -Dtools.jar="$TOOLS_JAR" \
    -Djava.security.debug="access,failure" \
    $STARTER_MAIN_CLASS \
    --main $CLASS \
    --conf "$GROOVY_CONF" \
    --classpath "$CP" \
    "$@"
    fi
    }

THE OUT PUT IS:

neo: ./groovy -version
/usr/jdk/latest
/export/groovytmp/groovy-1.5.4
./groovy
Starter Class Path is /export/groovytmp/groovy-1.5.4/lib/@GROOVYJAR@
Groovy Jar is /export/groovytmp/groovy-1.5.4/lib/groovy-1.5.4.jar
Java Opts are
Script Path is /export/groovytmp/groovy-1.5.4/bin/groovy
GROOVY CONFIG IS /export/groovytmp/groovy-1.5.4/conf/groovy-starter.conf
TOOLS_JAR is /usr/jdk/latest/lib/tools.jar
Groovy Home is /export/groovytmp/groovy-1.5.4
STARTER_MAIN_CLASS is org.codehaus.groovy.tools.GroovyStarter
CLASS is groovy.ui.GroovyMain
CP is .
@ is -version
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/tools/GroovyStarter
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.tools.GroovyStarter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
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:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
neo:

Any Thoughts....
Thanks,
-bcm

Show
Brenden Maher added a comment - Hi, I have really been pulling my hair out trying to get this to work so any help would be great!!! BTW I have a got a groovy version running on OSX but I need to get it running on solaris. I modified the startGroovy script like so- (output is at the bottom) startGroovy ( ) { CLASS=$1 shift
  1. Start the Profiler or the JVM if $useprofiler ; then runProfiler else echo Starter Class Path is $STARTER_CLASSPATH GROOVYJAR=/export/groovytmp/groovy-1.5.4/lib/groovy-1.5.4.jar export GROOVYJAR echo Groovy Jar is $GROOVYJAR echo Java Opts are $JAVA_OPTS SCRIPT_PATH=$GROOVY_HOME/bin/groovy export SCRIPT_PATH echo Script Path is $SCRIPT_PATH echo GROOVY CONFIG IS $GROOVY_CONF echo TOOLS_JAR is $TOOLS_JAR echo Groovy Home is $GROOVY_HOME echo STARTER_MAIN_CLASS is $STARTER_MAIN_CLASS echo CLASS is $CLASS echo CP is $CP echo @ is $@ exec "$JAVACMD" $JAVA_OPTS \ -classpath "$STARTER_CLASSPATH" \ -Dscript.name="$SCRIPT_PATH" \ -Dprogram.name="$PROGNAME" \ -Dgroovy.starter.conf="$GROOVY_CONF" \ -Dgroovy.home="$GROOVY_HOME" \ -Dtools.jar="$TOOLS_JAR" \ -Djava.security.debug="access,failure" \ $STARTER_MAIN_CLASS \ --main $CLASS \ --conf "$GROOVY_CONF" \ --classpath "$CP" \ "$@" fi }
THE OUT PUT IS: neo: ./groovy -version /usr/jdk/latest /export/groovytmp/groovy-1.5.4 ./groovy Starter Class Path is /export/groovytmp/groovy-1.5.4/lib/@GROOVYJAR@ Groovy Jar is /export/groovytmp/groovy-1.5.4/lib/groovy-1.5.4.jar Java Opts are Script Path is /export/groovytmp/groovy-1.5.4/bin/groovy GROOVY CONFIG IS /export/groovytmp/groovy-1.5.4/conf/groovy-starter.conf TOOLS_JAR is /usr/jdk/latest/lib/tools.jar Groovy Home is /export/groovytmp/groovy-1.5.4 STARTER_MAIN_CLASS is org.codehaus.groovy.tools.GroovyStarter CLASS is groovy.ui.GroovyMain CP is . @ is -version Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/tools/GroovyStarter Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.tools.GroovyStarter at java.net.URLClassLoader$1.run(URLClassLoader.java:200) 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:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) neo: Any Thoughts.... Thanks, -bcm
Hide
Paul King added a comment -

@GROOVYJAR@ is replaced by the Groovy version plus jar extension when packaging up the normal download zip. If you grabbed the new source file you would need to change that manually, e.g. it should be something like 'groovy-1.5.4.jar'.

Show
Paul King added a comment - @GROOVYJAR@ is replaced by the Groovy version plus jar extension when packaging up the normal download zip. If you grabbed the new source file you would need to change that manually, e.g. it should be something like 'groovy-1.5.4.jar'.
Hide
Brenden Maher added a comment -

Thanks so much for your time - thats good to know.
-Brenden

Show
Brenden Maher added a comment - Thanks so much for your time - thats good to know. -Brenden

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: