anchor.diff:  terminate(_Reason, #gen_java_state { nodename = undefined }) ->
       %% Java server isn't running; nothing to do
       ok;
  -terminate(_Reason, #gen_java_state{ nodename = N, port = Port, module = M }) ->
  +terminate(_Reason, #gen_java_state{ pid = Pid, nodename = N, port = Port, module = M }) ->
       %% Java server appears to still be running; send kill signal and wait
       %% for it to shutdown.
       unlink(Port),
       lager:info("[gen_java][~p] Sending `rex ! stop` from terminate", [M]),
       {rex, N} ! stop,
       safe_port_close(Port),
  +    %% Sometimes it needs to be put down
  +    os:cmd(?FMT("kill ~s", [Pid])),
       ok.
   
   -spec code_change(term(), #gen_java_state{}, term()) -> {ok, #gen_java_state{}}.
  
positive.code:     end.
  
  log_first_lines_from_port(Module, Port) ->
      log_port_lines(Module, Port,3).
  
  log_port_lines(_, _, 0) -> ok;
  log_port_lines(M, Port, N) ->
      receive
          {Port, {data, {_Type, Data}}} ->
              lager:info("[gen_java][~p] startup: ~p", [M, Data])
      after
          20000 ->
              lager:info("[gen_java] didn't output anything on startup")
      end,
      log_port_lines(M, Port, N-1).
  
negative.code: -define(DEFAULT_THREAD_COUNT, 10).
  
  -record(gen_java_state, {
            pid      = undefined :: string() | undefined,
            module   = undefined :: module() | undefined,
            config   = undefined :: [proplists:property()] | undefined,
            nodename = undefined :: atom() | undefined,
  