linux 查看 java版本提示错误

卸载掉open jdk,重新安装sun1.7jdk,查看后提示:

[root@localhost java]# java –version

Unrecognized option: –version

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

是命令不同造成,1.7查看命令为

[root@localhost java]# java -version
java version “1.7.0_79”
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

    原文作者:cpp_lzth
    原文地址: https://blog.csdn.net/cpp_lzth/article/details/77429810
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞