How can I install and run Groovy console/IDE from the dock on Mac Sierra?
Follow these instructions http://sdkman.io/install.html and make sure you restart your terminal session after each step;
$ sdk install groovyto install groovy (I assume you have jdk already installed);
Start your Groovy Console in terminal
It runs as a separate process;
$ ps aux |grep groovy- you will find out that the console is run as
/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java -Xdock:name=GroovyConsole -Xdock:icon=/Users/yourname/.sdkman/candidates/groovy/current/lib/groovy.icns -classpath /Users/yourname/.sdkman/candidates/groovy/current/lib/groovy-2.4.14.jar -Dscript.name=/Users/yourname/.sdkman/candidates/groovy/current/bin/groovyConsole -Dprogram.name=groovyConsole -Dgroovy.starter.conf=/Users/yourname/.sdkman/candidates/groovy/current/conf/groovy-starter.conf -Dgroovy.home=/Users/yourname/.sdkman/candidates/groovy/current -Dtools.jar=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/lib/tools.jar org.codehaus.groovy.tools.GroovyStarter --main groovy.ui.Console --conf /Users/yourname/.sdkman/candidates/groovy/current/conf/groovy-starter.conf --classpath .
I will refer that mess as
Exit the console and start
automator.app, choose Application and double-click
Run Shell Scriptaction;
Save it as groovyConsole.app to your home folder and exit automator;
~/groovyConsole.app/Contents/Info.plistand change 3 lines:
<key>CFBundleExecutable</key> <string>fuckmac</string> <key>CFBundleIconFile</key> <string>groovy</string> <key>CFBundleIdentifier</key> <string>com.apple.groovyConsole</string>
~/groovyConsole.app/Contents/MacOS/fuckmacand make it read:
#!/bin/bash exec -c jvm-verylongline
jvm-verylonglineas per above, obviously;
$ chmod +x ~/groovyConsole.app/Contents/MacOS/fuckmac
As the icon is conveniently named in the
$ cp /Users/yourname/.sdkman/candidates/groovy/current/lib/groovy.icns ~/groovyConsole.app/Contents/Resources/
Now you should be able to run the app by double-clicking it in Finder, but probably still with the wrong icon due to caching;
Drag-and-drop the app from your home folder to Applications in Finder - this is when the icon malarkey gets fixed;
Now you can also drag-and-drop to dock the app.
Note: This solution was originally posted by the OP as an edit to the question