How to install java version in windows git bash?

How do you install java version for use in git bash windows? Does it work through environment variables? Java -version provides a different version on the dos command line than on git bash ...

+6
source share
2 answers

You are not installing the java version. You are looking for environment variables $PATH (bash) and %PATH% (Windows / DOS / cmd.exe). When you run the java -version , the shell looks for directories on $PATH to find the java program and starts it with the given arguments. If you get different results in different shells, it means that you have different PATH, so another Java installation will be found.

+6
source
  • Go to System Properties → Advanced → Environment Variables
  • New system variable
  • Variable Name: PATH
  • 'Variable value': C \ Program Files \ Java \ jdk-9 \ bin (or any other path)
  • Reboot Git Bash

(Windows 10)

0
source

Source: https://habr.com/ru/post/921678/


All Articles