mhayashi1120/Emacs-langtool

java command is not found

Jakkaps opened this issue · 1 comments

When using the "M-x langtool-check" command, I receive the error "java command not found"

This is my .emacs file:
(add-to-list 'load-path "~/.emacs.d/LanguageTool-4.3/") (setq langtool-java-bin "/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin") (setq langtool-language-tool-jar "~/.emacs.d/LanguageTool-4.3/languagetool-commandline.jar") (setq langtool-default-language "en-US") (require 'langtool)

I installed the melpa package, java and downloaded version 4.3 of langtool.
There´s nothing wrong with the langtool download, as it works perfectly fine from the command-line. What am I doing wrong?

When using the "M-x langtool-check" command, I receive the error "java command not found"

This is my .emacs file:
(add-to-list 'load-path "~/.emacs.d/LanguageTool-4.3/") (setq langtool-java-bin "/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin") (setq langtool-language-tool-jar "~/.emacs.d/LanguageTool-4.3/languagetool-commandline.jar") (setq langtool-default-language "en-US") (require 'langtool)

I installed the melpa package, java and downloaded version 4.3 of langtool.
There´s nothing wrong with the langtool download, as it works perfectly fine from the command-line. What am I doing wrong?

I am on Windows 10, so I am not sure whether this will help you or not (and I am responding pretty late to this question), but what worked for me was resetting the langtool-java-bin variable back to the default, which for my machine was just "java". I have java in my path so I am guessing it finds it automatically instead of through the file path I had as a variable like you do. After resetting the variable back to default everything worked fine.