java linux centos DISPLAY环境变量

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6827087/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 05:15:59  来源:igfitidea点击:

java linux centos DISPLAY environment variable

javalinuxinstall

提问by Lorenzo Manucci

I have download java_ee_sdk-6u2-unix-ml.sh for install on CENTOS.

我已下载 java_ee_sdk-6u2-unix-ml.sh 以安装在 CENTOS 上。

But when try install - receive this error:

但是当尝试安装时 - 收到此错误:

This program requires DISPLAY environment variable to be set.
Please re-run after assigning an appropriate value to DISPLAY.

But this is server - I cannot install graphic system. What can i do? Thanks.

但这是服务器 - 我无法安装图形系统。我能做什么?谢谢。

采纳答案by Jigar Joshi

edit bash profile

编辑 bash 配置文件

vi ~/.bash_profile

set variable

设置变量

export DISPLAY=<VALUE>

save and close and to test

保存并关闭并测试

echo $DISPLAY

回答by barti_ddu

You can either:

您可以:

  1. Generate an answer file on any machine wich has GUI (run setup in dry runmode)

    ./java_ee_sdk-6u2-unix-ml.sh -n template

    and then use that template on server machine with silent modeoption

    ./java_ee_sdk-6u2-unix-ml.sh -a template -s

  2. Unzip installation manually

  1. 在任何具有 GUI 的机器上生成应答文件(在试运行模式下运行设置)

    ./java_ee_sdk-6u2-unix-ml.sh -n template

    然后在带有静默模式选项的服务器机器上使用该模板

    ./java_ee_sdk-6u2-unix-ml.sh -a template -s

  2. 手动解压安装

回答by Hymantrades

Try this, before executing:

在执行之前试试这个:

export DISPLAY=:0

If you're connecting through Putty to a headless system, don't forget to have X11 client on your local machine.

如果您通过 Putty 连接到无头系统,请不要忘记在本地计算机上安装 X11 客户端。