环境:
centos6.0 64位
java version "1.7.0_40"

问题描述:安装java后通过“java --version”命令查看java的版本报错

[root@101 jdk1.7]# java --version   
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.         #无法创建java虚拟机
Error: A fatal exception has occurred. Program will exit. #程序退出

通过查找资料和查看帮助,发现在centos6中java1.7的操作指令集不同,应该使用:java -version来查看版本信息

-version    print product version and exit
-version:<value>
            require the specified version to run

相关文章:

  • 2022-12-23
  • 2021-09-12
  • 2022-02-08
  • 2022-01-26
  • 2021-07-10
  • 2021-11-14
  • 2022-12-23
猜你喜欢
  • 2021-10-01
  • 2021-08-07
  • 2021-10-02
  • 2021-06-26
  • 2021-11-14
  • 2021-07-16
相关资源
相似解决方案