windows - %M2% not working in system variable Path but in user variable Path only -
I'm setting up Maven and I need to set M2 and M2_Home. I have set them in the user variable in the Environment variable. And I was hoping to be able to run the path variable in the system variable in the So I had this problem. Unless I created a path variable in the user variable and added You have to look at the Windows source code to make sure what's going on, Not surprisingly, on the basis of my trial, it appears that system environment variables can only refer to other system environment variables, not user environment variables Note that This is because sometimes the system environment variables need to be expanded in situations where there is no user context if the user environment variable was included in the expansion of the system environment variable then it would be special case Should be considered as. It is also possible that it is considered preferred behavior so that the user's environment variables can not affect the interpretation of system variables unexpectedly, or environmental variables have been inherited in the process. Add either ;% M2% I was able to run
mvn --version but I could not However, if I resonate
% pound% I can see that in the path there is
% M2% and if I
echo% M2% I
% M2% to it, then Was the problem is solved and remove it from the path system variable. Now it is working. Does anyone know why this is working only in a specific way?
echo% PATH% should show the extended path you should not see
% M2% .
% M2% to the user path or make the system
M2 instead of the user environment variable.
Comments
Post a Comment