mvn-v显示java信息

mvn-v显示java信息,java,maven,Java,Maven,我已经安装了jdk8 JAVA_HOME设置为C:\Program Files\JAVA\jdk1.8.0_60(JDK 8的安装路径) PATH变量用%JAVA\u HOME%\bin修改;C:\maven\bin(maven 3.3.3的安装路径) 当我在cmd中键入mvn-v时,预期结果不会显示。相反,显示的结果等于我在cmd中键入java时的结果。 只有当cmd位于D:drive内时,我键入mvn-v时才会出现此错误。适用于C: 结果应该是:(如中所示) 结果我实际得到: D:\>

我已经安装了jdk8

JAVA_HOME设置为
C:\Program Files\JAVA\jdk1.8.0_60
(JDK 8的安装路径)

PATH变量用
%JAVA\u HOME%\bin修改;C:\maven\bin
(maven 3.3.3的安装路径)

当我在cmd中键入
mvn-v
时,预期结果不会显示。相反,显示的结果等于我在cmd中键入
java
时的结果。 只有当cmd位于D:drive内时,我键入
mvn-v
时才会出现此错误。适用于C:

结果应该是:(如中所示)

结果我实际得到:

D:\>mvn -v
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32          use a 32-bit data model if available
    -d64          use a 64-bit data model if available
    -server       to select the "server" VM
                  The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -no-jre-restrict-search
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
D:\>mvn-v
用法:java[-options]类[args…]
(执行一个类)
或java[-options]-jar jarfile[args…]
(执行jar文件)
其中包括:
-d32使用32位数据模型(如果可用)
-d64使用64位数据模型(如果可用)
-选择“服务器”虚拟机的服务器
默认VM是服务器。
-cp
-类路径
A.单独的目录列表、JAR归档、,
和压缩档案以搜索类文件。
-D=
设置系统属性
-详细:[类| gc | jni]
启用详细输出
-版本打印产品版本并退出
-版本:
警告:此功能已弃用,将被删除
在未来的版本中。
需要指定的版本才能运行
-showversion打印产品版本并继续
-jre限制搜索|-无jre限制搜索
警告:此功能已弃用,将被删除
在未来的版本中。
在版本搜索中包括/排除用户专用JRE
-? -帮助打印此帮助消息
-关于非标准选项的X打印帮助
-ea[:…|:]
-启用评估[:…|:]
启用具有指定粒度的断言
-da[:…;:]
-取消分配[:…|:]
禁用具有指定粒度的断言
-esa |-启用系统断言
启用系统断言
-dsa |-禁用系统断言
禁用系统断言
-agentlib:[=]
加载本机代理库,例如-agentlib:hprof
另请参见-agentlib:jdwp=help和-agentlib:hprof=help
-代理路径:[=]
按完整路径名加载本机代理库
-javaagent:[=]
加载Java编程语言代理,请参阅Java.lang.instrument
-飞溅:
用指定的图像显示启动屏幕
看见http://www.oracle.com/technetwork/java/javase/documentation/index.html 更多细节。

您能否分享从
mvn-v
获得的确切输出以及预期得到的结果?在控制台中键入
java-version
时,您会看到什么?我假设您使用的是windows控制台?请尝试将路径放在双引号(“)内的
JAVA\u HOME
set JAVA\u HOME=“C:\Program Files\JAVA\jdk1.8.0\u 60“
在环境变量中添加maven路径后。您应该在新的命令提示符窗口(而不是旧窗口)中运行命令。确认您是在新控制台还是旧控制台中运行。关闭控制台,打开新控制台,然后键入以下内容:
echo%JAVA\u HOME%
echo%PATH%
。。。告诉我们你看到了什么
D:\>mvn -v
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32          use a 32-bit data model if available
    -d64          use a 64-bit data model if available
    -server       to select the "server" VM
                  The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -no-jre-restrict-search
                  Warning: this feature is deprecated and will be removed
                  in a future release.
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.