A small improvement to GroovyConsole

Posted by: Andres Almiray on 05/04/2010
If you're a Mac user you've probably noticed that running a Java based application results in a default icon being placed in the dock. Groovy's console application is no exception, as the following pic bears witness



However, fixing this issue is simple; you just need to add a JVM option like the following one:
-Xdock:icon=/path/to/your/icons.icns
Where can this option be added you ask? Why yes, here is how you can do it:
  1. Go to $GROOVY_HOME/bin
  2. Edit startGroov
  3. Search for JAVA_OPTS and Darwin. You'll find a line that looks like this
    if $darwin; then
        JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GROOVY_APP_NAME"
    fi
    
  4. Add the -Xdock:icon entry to that line et voilĂ !
Alternatively you can wait for the next release of Groovy, which most likely will come with a default Groovy icon, like the following one



Keep on Groovying!

About Andres Almiray

Andres Almiray

Andres is a Java/Groovy developer and Java Champion, with more than 11 years of experience in software design and development. He has been involved in web and desktop application developments since the early days of Java. He has also been teacher of computer science courses in the most prestigious education institute in Mexico. His current interests include Groovy and Swing. He is a true believer of open source and has participated in popular projects like Groovy, Griffon, JMatter and DbUnit, as well as starting his own projects (Json-lib, EZMorph, GraphicsBuilder, JideBuilder). Founding member and current project lead of the Griffon framework. He blogs periodically at http://jroller.com/aalmiray. You can find him on twitter too as @aalmiray. He likes to spend time with his beloved wife, Ixchel, when not hacking around.

More About Andres »

NFJS, the Magazine

May Issue Now Available
  • Client-Side MVC with Spine.js, Part 1

    by Craig Walls
  • On Prototypal Inheritance, Part 2

    by Raju Gandhi
  • Making use of Scala Lazy Collections

    by Venkat Subramaniam
  • Integration Testing Web Applications Using Gradle

    by Kenneth Kousen
Learn More »