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 ;% 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

So I had this problem. Unless I created a path variable in the user variable and added % 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?

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 echo% PATH% should show the extended path you should not see % M2% .

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% to the user path or make the system M2 instead of the user environment variable.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -