0

This is very similar it seems, to discover-why-godc-wont-start-on-mac but I Can't comment and what I have isn't an answer so I'm opening a new question.

I have this problem where the Go Agent won't stay running on my Mac. It launches and then quickly exits. The log seems like a java issue but I have Java 8 and then also tried java 11, and neither worked. Here is the output of the log, but I cannot figure out if the version of Java is the issue or if it's something else.

``` Thu Jan 10 14:19:50 EST 2019: Setting working directory: /Users/buildadmin/Library/Application Support/Go Agent

Thu Jan 10 14:19:50 EST 2019: Setting environment variables:
AGENT_STARTUP_ARGS="-Xms128m -Xmx256m"

Thu Jan 10 14:19:50 EST 2019: Final environment variables are:
AGENT_STARTUP_ARGS=-Xms128m -Xmx256m
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.WzPSMYxWM1/Render
HOME=/Users/buildadmin
LOGNAME=buildadmin
OLDPWD=/
PATH=/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/buildadmin/Library/Application Support/Go Agent
SHELL=/bin/bash
SHLVL=1
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.42xu8T62mh/Listeners
TMPDIR=/var/folders/_c/qfw_0cs93kq1ylslsh82llnr0000gp/T/
USER=buildadmin
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
_=/usr/bin/env
__CF_USER_TEXT_ENCODING=0x1F6:0x0:0x0

Thu Jan 10 14:19:50 EST 2019: Running:
Thu Jan 10 14:19:50 EST 2019:   /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin/java
Thu Jan 10 14:19:50 EST 2019:   -cp
Thu Jan 10 14:19:50 EST 2019:   /Users/buildadmin/Desktop/Go Agent.app/Contents/Resources/agent-bootstrapper.jar
Thu Jan 10 14:19:50 EST 2019:   -Xdock:icon=/Users/buildadmin/Desktop/Go Agent.app/Contents/Resources/go-agent.icns
Thu Jan 10 14:19:50 EST 2019:   -Xdock:name=Go Agent
Thu Jan 10 14:19:50 EST 2019:   -Dgo.application.name=Go Agent
Thu Jan 10 14:19:50 EST 2019:   -Dgo.java.to.use=/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin/java
Thu Jan 10 14:19:50 EST 2019:   -Dcruise.server.port=8153
Thu Jan 10 14:19:50 EST 2019:   -Dcom.apple.mrj.application.apple.menu.about.name=Go Agent
Thu Jan 10 14:19:50 EST 2019:   -Dapple.laf.useScreenMenuBar=true
Thu Jan 10 14:19:50 EST 2019:   -Done-jar.main.class=com.thoughtworks.go.agent.bootstrapper.osx.AgentMacWindow
Thu Jan 10 14:19:50 EST 2019:   -Dcruise.server.host=127.0.0.1
Thu Jan 10 14:19:50 EST 2019:   com.simontuffs.onejar.Boot
Thu Jan 10 14:19:50 EST 2019:   127.0.0.1 8153

logFile Environment Variable= null
Logging to go-agent-bootstrapper.log
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.simontuffs.onejar.Boot.run(Boot.java:306)
    at com.simontuffs.onejar.Boot.main(Boot.java:159)
Caused by: java.lang.NoSuchMethodError: com.apple.eawt.Application.setEnabledPreferencesMenu(Z)V
    at com.thoughtworks.go.agent.bootstrapper.osx.AgentMacWindow.initializeApplicationAdapter(AgentMacWindow.java:76)
    at com.thoughtworks.go.agent.bootstrapper.osx.AgentMacWindow.<init>(AgentMacWindow.java:65)
    at com.thoughtworks.go.agent.bootstrapper.osx.AgentMacWindow.main(AgentMacWindow.java:47)
    ... 6 more 




  • (While quoted literally, [Discover why GoDC won't start on Mac](https://stackoverflow.com/q/48259842) misspells GoCD.) – greybeard Jan 10 '19 at 22:22
  • Anyone have any idea why the Mac app or in general why a mac app would launch and quit.. There aren't any compatibility issues since this machine used to run the exact same version of this before it was restored. – Robert Lounsberry Jan 14 '19 at 14:28
  • Seems very similar to the issue described on this [link](https://stackoverflow.com/a/13980873/1058334). Based on your log stack trace, the JDK was able to find ui.jar but not the one that's compatible with GoCD. I think JDK 11 isn't supported that could be the reason. Can you please post the stack trace with JDK 8 too? –  Jan 21 '19 at 09:26
  • The Java version was certainly the issue. – Robert Lounsberry Jun 25 '19 at 13:42

1 Answers1

0

The problem was discovered to be the version of Java JDK that was installed. Apparently the GOCD agent doesn't like the latest version of the JDK so I downgraded to version 8 and everything kicked into gear. Thanks for all the suggestions.