1. 避免多次重複設置或着修改系統環境變量。
@echo off
set JAVA_HOME=C:\Users\Desktop\JRE1.6.0.30set M2_HOME=C:\Users\............
@rem %M2_HOME%\ to run any bat you want use JAVA_HOME=C:\Users\Desktop\JRE1.6.0.30.
2.設置當前用戶環境變量。
Search "env" in sys Search. find out Environment Variables dialog.
Cope all the path value in System variables and create a new path in User variables then past the cope value. Then you can do what ever you want in User's path.