[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)