0
How can I install and run Groovy console/IDE from the dock on Mac Sierra?
0
How can I install and run Groovy console/IDE from the dock on Mac Sierra?
0
Follow these instructions http://sdkman.io/install.html and make sure you restart your terminal session after each step;
Say $ sdk install groovy
to install groovy (I assume you have jdk already installed);
Start your Groovy Console in terminal
$ ~/.sdkman/candidates/groovy/current/bin/groovyConsole
It runs as a separate process;
Say $ 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 jvm-verylongline
Exit the console and start automator.app
, choose Application and double-click Run Shell Script
action;
Save it as groovyConsole.app to your home folder and exit automator;
Edit ~/groovyConsole.app/Contents/Info.plist
and change 3 lines:
<key>CFBundleExecutable</key>
<string>fuckmac</string>
<key>CFBundleIconFile</key>
<string>groovy</string>
<key>CFBundleIdentifier</key>
<string>com.apple.groovyConsole</string>
Create file ~/groovyConsole.app/Contents/MacOS/fuckmac
and make it read:
#!/bin/bash
exec -c jvm-verylongline
Replacing jvm-verylongline
as per above, obviously;
Say $ chmod +x ~/groovyConsole.app/Contents/MacOS/fuckmac
As the icon is conveniently named in the jvm-verylongline
, do
$ 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
Try asking on the apple forum here: https://apple.stackexchange.com/
– HackSlash – 2018-03-02T20:55:35.1201Does that 'best solution' work for you? If so you should post it as an answer, and not as part of the question :) – bertieb – 2018-03-03T11:16:27.780
@bertieb answer converted to community wiki – I say Reinstate Monica – 2018-03-17T16:00:02.500
Can I have a link to that wiki @ – wick – 2018-03-17T16:05:56.937