参考

Microsoft Windows Server 2008 R2 Enterprise 安装失败 windows 10 没测试

  1. @echo off
  2. echo 配置maven
  3. set RegV=HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
  4. set /p maven=请输入Maven的安装目录(如:D:\java\apache-maven-3.3.9):
  5. set PATH=%PATH%;%%MAVEN_HOME%%\bin
  6. reg add "%RegV%" /v "MAVEN_HOME" /d "%maven%" /f
  7. reg add "%RegV%" /v "Path" /t REG_EXPAND_SZ /d "%PATH%" /f
  8. echo Maven配置完成,按任意键检查是否配置正确!&pause>nul
  9. ::调用自身查看javamaven版本
  10. %0