How do you set the java version to use in a windows git bash? Does it work via the environment variables? Java -version gives another version in dos command prompt than in git bash…
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You don’t set the java version. You are seeking the
$PATH(bash) and the%PATH%(Windows/DOS/cmd.exe) environment variables. When you run the commandjava -version, the shell searches the directories on the$PATHto locate thejavaprogram and run it with the given arguments. If you get different results in different shells then that means you have different PATHs such that a different installation of Java is found.