Setting up grammar check with Doom Emacs in Mac OS X

Published on Nov 11, 2021, by Junji Zhi

Doom Emacs supports grammar check with Language Tools and writegood-mode.

To turn it on, we update the init.el:

;; ...

Also it requires setting up java and Language Tools:

brew install java languagetool

However, the language tool didn't work out of box with the default Homebrew install. It complains:

LanguageTool exited abnormally with code 1 (The operation couldn t be completed. Unable to locate a Java Runtime.)

I have to manually update the java executable:

(setq langtool-java-bin "/usr/local/opt/openjdk/bin/java")

Then running M-x langtool-check-buffer works!