When you run the above it will open a new command prompt with JAVA_HOME set to that location for only that instance of cmd.exe. When you close it, your %JAVA_HOME% will point to your original location.