Disable company-mode in java-mode

What happened?

i’m trying to disable company-mode when in java-mode, reading the doco for compnay-mode i think one of these should work, have both in my config.el at the moment

(add-hook! 'java-mode-hook
           (company-mode 0))

(setq company-global-modes '(not java-mode))

What did you expect to happen?

i expected company-mode to be disabled in java-mode but it’s still active

Steps to reproduce

  1. add the code fragment to config.el
  2. exit emacs
  3. doom sync
  4. open .java file

System information


Loading data dump...