回到顶部

阅读目录

centos7 java -verison Error: Could not create the Java Virtual Machine.

错误情况

[root@gitlab download]# java -verison
Unrecognized option: -verison
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

解决办法

environment

vim /etc/environment

增加一行

export _JAVA_OPTIONS="-Xms64m -Xmx64m -Xmn32m"

让 environment 生效

source /etc/environment

生效后重新运行 java -version

[root@gitlab download]# java -verison
Unrecognized option: -verison
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[root@gitlab download]# 
[root@gitlab download]# vim /etc/environment 
[root@gitlab download]# source /etc/environment 
[root@gitlab download]# java -version
Picked up _JAVA_OPTIONS: -Xms64m -Xmx64m -Xmn32m
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)

 


^_^
请喝咖啡 ×

文章部分资料可能来源于网络,如有侵权请告知删除。谢谢!

前一篇: Django admin admin_order_field 自定义字段排序实现方法
下一篇: selenium-server-standalone 分布式自动化测试 搭建