Skip to content

Commit

Permalink
GROOVY-8718: GroovyConsole MacOS fix required for JDK9+
Browse files Browse the repository at this point in the history
  • Loading branch information
paulk-asert committed Jul 28, 2018
1 parent 3e460f4 commit 5e026fd
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@
*/
package groovy.ui.view

import org.codehaus.groovy.vmplugin.VMPluginFactory

def handler = false
def jdk9plus = VMPluginFactory.getPlugin().getVersion() > 8
// TODO Desktop handlers are supposed to work cross platform, should we do version check at a higher layer
// TODO there is also an open files handler, should we also be using that?
if (!handler) {
try {
handler = build("""
handler = build(jdk9plus ? """
def handler = Desktop.getDesktop()
handler.setAboutHandler(controller.&showAbout)
handler.setQuitHandler(controller.&exit)
handler.setPreferencesHandler(controller.&preferences)
handler
""" : """"
package groovy.ui
import com.apple.mrj.*
Expand Down

0 comments on commit 5e026fd

Please sign in to comment.