0

I'm starting spacemacs from a git-bash in Windows 10. Compared with starting spacemacs from Windows command shell, I find it fewer problem of configuration.

However, with the spacemacs started from git-bash, I run into a problem of not able to find java.exe, with the following error message:

/usr/bin/bash: java: command not found

In the launching git-bash, the java is accessible as demonstrated as follows:

$ which java
/c/Program Files (x86)/Common Files/Oracle/Java/javapath/java

Inside the spacemacs, I checked the value of exec-path, it indeed has the path for the java executable.

I checked the content of PATH, by

(getenv "PATH")

the path for java executable is not found there.

I further experiment to add the path to java executable to PATH by the following:

(setenv "PAHT" (concat "C:/Program Files (x86)/Common Files/Oracle/Java/javapath" path-separator (getenv "PATH")))

It still does not work.

Strange enough, in the launching git-bash, the content of $PATH contains the path to java executable, but inside the launched spacemacs, the content of $PATH does not contain that.

As last resort, I'm adding the path to java executable to PATH in .bash_profile, hoping it will have an impact on the content of $PATH in the launched spacemacs, as suggested by How to get Exec-path-from-shell working in Spacemacs. But it still doesn't work.

I also observed that inside the launched spacemacs, with eshell, java command is also not found. It seems that it might have the same root cause.

I also have the same issue to access git, firefox, inside spacemacs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.