neatbeans maven javafx项目如何安装好maven

How to install maven well for neatbeans maven javafx project

我喜欢 运行 我的项目时遇到问题:

找不到com.oracle:ojdbc7:jar:11.2

Pom.xml:

    <dependencies>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>5.1.0.Final</version>
    </dependency>
    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc7</artifactId>
        <version>11.2.0</version>
    </dependency>
</dependencies>

我想,maven 在我的 Win10 上没有安装好。 所以我做了什么:

https://maven.apache.org/install.html -> 我下载二进制 zip 存档(第一个选择)

我解压复制到C:\ -> C:\apache-maven-3.3.9下

我设置了系统变量(我之前也试过环境)

M2_HOME = C:\apache-maven-3.3.9 
 and
M2 = %M2_HOME%\bin 

如果我以管理员模式打开 cmd 并写入:

echo %M2% -> C:\apache-maven-3.3.9\bin

echo %M2% -> C:\apache-maven-3.3.9

如果我写:mvn --version or maven -version:

C:\WINDOWS\system32>mvn --version
'mvn' is not recognized as an internal or external command,
operable program or batch file.

C:\WINDOWS\system32>mvn -version
'mvn' is not recognized as an internal or external command,
operable program or batch file.

有什么问题?

M2变量添加到PATH环境变量:

PATH=%PATH%;%M2%