Windows 10 user. I recently installed git for the first time, but ran into a peculiar issue. I was told that I needed to set the JAVA_HOME
environment variable if I wanted to use java within git.
I was able to get JAVA_HOME
properly changed for command prompt, but I couldn't get the same change to show up in git bash. Typing in echo %JAVA_HOME%
would return a proper path in command prompt, but it would return %JAVA_HOME%
in git bash.
I went into system settings and changed the system variable so that JAVA_HOME
was pointing to my jdk. I updated the PATH
variable in both system and environment variables to point to the bin and the jdk. I closed and reopened both git bash and command prompt. I restarted my machine, and even reinstalled both git and my jdk. I took my jdk from Java 10.0.2 down to the latest java 8 (171).
None of it has worked. I've gone through countless SO posts. What am I doing wrong?