Maven M2_HOME 设置为无效目录 (Windows 7) [英] Maven M2_HOME set to an invalid directory (Windows 7)

查看:17
本文介绍了Maven M2_HOME 设置为无效目录 (Windows 7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将 Maven 安装到 Windows 7,但结果不佳.一些基本信息:

I've tried installing Maven to Windows 7 with poor results. Some basic info:

Maven 安装目录:C:Program FilesApache Software Foundationapache-maven-3.0.4系统变量M2_HOME":C:Program FilesApache Software Foundationapache-maven-3.0.4系统变量Path":%M2_HOME%apache-mavensrcin;%JAVA_HOME%in

Maven installation directory: C:Program FilesApache Software Foundationapache-maven-3.0.4 System Variable "M2_HOME": C:Program FilesApache Software Foundationapache-maven-3.0.4 System Variable "Path" : %M2_HOME%apache-mavensrcin;%JAVA_HOME%in

如果我在命令路径中运行 mvn --version,我会收到错误消息:

If I run mvn --version in the command path, I get the error message:

请在您的环境中设置 M2_HOME 变量以匹配 Maven 安装位置

Please set the M2_HOME variable in your environment to match the location of the Maven installation

所以目前mvn的子目录没有按照说明设置,应该是%M2_HOME%in.如果我用那个替换 %M2_HOME%apache-mavensrcin ,我得到:

So at the moment the subdirectory for mvn is not set according to the instructions, which would be %M2_HOME%in. If I replace %M2_HOME%apache-mavensrcin with that one, I get:

mvn 不是内部或外部命令,也不是可运行的程序或批处理文件

mvn is not recognized as an internal or external command, operable program or batch file

在 Maven 安装目录中(或在 zip 文件中)没有 in 文件夹直接在 apache-maven-3.0.4 中,我想知道是否有应该是一个?

In the Maven installation directory (or in the zip-file) there is no in 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 校验和检查文件.

If your downloaded package apache-maven-3.3.9 does not contain a bin folder your download is wrong. you have to download a zip file which contains bin, boot, conf, lib folder otherwise there has gone something wrong. The downloaded file should have about 4.8 mb size. You can check the file via md5 or SHA1 checksums.

这篇关于Maven M2_HOME 设置为无效目录 (Windows 7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆