问题描述
我曾尝试将Maven安装到Windows 7,但效果不佳.一些基本信息:
I've tried installing Maven to Windows 7 with poor results. Some basic info:
Maven安装目录:C:\Program Files\Apache Software Foundation\apache-maven-3.0.4
系统变量"M2_HOME
":C:\Program Files\Apache Software Foundation\apache-maven-3.0.4\
系统变量"Path
":%M2_HOME%apache-maven\src\bin;%JAVA_HOME%\bin
Maven installation directory: C:\Program Files\Apache Software Foundation\apache-maven-3.0.4
System Variable "M2_HOME
": C:\Program Files\Apache Software Foundation\apache-maven-3.0.4\
System Variable "Path
" : %M2_HOME%apache-maven\src\bin;%JAVA_HOME%\bin
如果我在命令路径中运行mvn --version
,则会收到错误消息:
If I run mvn --version
in the command path, I get the error message:
因此,目前未按照说明设置mvn
的子目录,该子目录为%M2_HOME%\bin
.如果我用那个替换%M2_HOME%apache-maven\src\bin
,我得到:
So at the moment the subdirectory for mvn
is not set according to the instructions, which would be %M2_HOME%\bin
. If I replace %M2_HOME%apache-maven\src\bin
with that one, I get:
在Maven安装目录(或zip文件)中,直接在apache-maven-3.0.4
中没有\bin
文件夹,我想知道是否应该有一个文件夹?
In the Maven installation directory (or in the zip-file) there is no \bin
folder directly in apache-maven-3.0.4
and I wonder if there should be one?
我是Maven的新手,希望你们能为您提供帮助.
I'm a complete novice to Maven, hopefully you guys can help.
通过Java命令可从任何目录工作的方式,所以我认为这不是问题所在,但我不确定.
By the way the Java command works from any directory, so I don't think that's the issue here, but I can't be sure.
推荐答案
如果您下载的软件包apache-maven-3.3.9不包含bin文件夹,则您的下载错误.您必须下载一个包含bin,boot,conf,lib文件夹的zip文件,否则出现问题.下载的文件应具有约4.8 mb的大小.您可以通过md5或SHA1校验和检查文件.
这篇关于Maven M2_HOME设置为无效目录(Windows 7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!