简体   繁体   中英

Setting up the configuration of Maven and Ant in environment variables

I have configured Maven in an environment variable and checked it in the command prompt and it works. Then I setup and configured Ant in environment variables and checked it in the command prompt and it works but Maven is not working. The problem I found out is the Path variable name. I only can set either one of them. How should I configure my environment to make sure both Maven and Ant are working at the same time?

Variable name: Path

Variable value: C:\\Program Files\\Apache Software Foundation\\apache-maven-3.3.9\\bin C:\\Program Files\\Apache Software Foundation\\apache-ant-1.9.6\\bin

I believe what's happening here is that you aren't using:

  1. a path separator in your PATH environment variable (for Windows it's a semi-colon).
  2. quotation marks when your paths have spaces.

Bad:

Path Variable value: C:\Program Files\Apache Software Foundation\apache-maven-3.3.9\bin C:\Program Files\Apache Software Foundation\apache-ant-1.9.6\bin

Good:

PATH="C:\Program Files\Apache Software Foundation\apache-maven-3.3.9\bin";"C:\Program Files\Apache Software Foundation\apache-ant-1.9.6\bin"

Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM