Set environment variables from command line - and make them stick globally [duplicate]
Solution 1:
As mentioned in more detail in How do I set PATH and other environment variables?, you can use setx
to set a variable permanently:
setx MyVariable "C:\Path\to\Folder"
setx JAVA_HOME "C:\Path\to\Java"
et cetera.