How to set java_home in windows command line




















Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 3 years ago. Active 1 year, 7 months ago.

Viewed 33k times. Improve this question. Add a comment. Active Oldest Votes. It doesn't change value in path or java -version doesn't change in current instance of cmd You have to restart cmd for the changes to take effect as a cmd shell inherits it environment from the parent process. So what is the correct way to switch between Java versions from the command line? Use a set of batch files, as follows: Being a Java developer, I always compile and test my code on different Java versions.

Improve this answer. When I was installing git, I changed the save location. I had been installing and practicing a bunch of new tools, and I wanted to have them all in one isolated spot. Just goes to show that the default way is usually the best way. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 3 years, 6 months ago. Active 2 years, 7 months ago. Viewed 76k times. Improve this question. MrTux Then it is possibly not set at all. You should have permission to read any directories that might contain java libraries you'd reference, so you can ignore "Permission denied" messages. If all else fails, try buying your system administrator a decent cup of coffee and asking nicely.

The syntax is roughly the same either way, but where you set the value changes. The double quotes are required if your path contains any imbedded blanks. You will need to know what shell you're using and what the appropriate way to set environment variables in that shell is. The two most popular shells are the Bourne shell and its relatives, and different variations on the C-shell.

We'll show syntax for both of those here. Viewed 75k times. What am I doing wrong, and how can I debug this. Improve this question. Sathia 5, 4 4 gold badges 40 40 silver badges 61 61 bronze badges. Philip Kirkbride Philip Kirkbride Did you restart your command console? Add a comment. Active Oldest Votes. Make sure that the jdk. Improve this answer. Jeremy Jeremy 2, 3 3 gold badges 22 22 silver badges 31 31 bronze badges.

Notice the part of my question where I say " I've also tried several variations including linking to the bin folder where java. Restarted the command prompt but not the computer. For example, type java from the command prompt, does that work? When I type Java in command prompt it seems to work, tells me the usage — Philip Kirkbride.



0コメント

  • 1000 / 1000