An unexpected error has been detected by HotSpot Virtual Machine及DISPLAY not set

 

近期在学习Oracle数据库,下载下来数据库后,按照网络上的教程在Linux上安装,但是遇到了一些小坑,这里做个记录,也为了大家少踩坑

 

1.DISPLAY未设置

这个错误发生在执行 ./runInstaller 命令安装Oracle时,提示以下错误:

>>> Ignoring required pre-requisite failures. Continuing...
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-08-31_01-37-49AM. Please wait ...
DISPLAY not set. Please set the DISPLAY and try again.
Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:
- For csh:  			% setenv DISPLAY 192.168.1.128:0.0
- For sh, ksh and bash: 	$ DISPLAY=192.168.1.128:0.0; export DISPLAY
Use the following command to see what shell is being used:
	echo $SHELL
Use the following command to view the current DISPLAY environment variable setting:
	echo $DISPLAY
- Make sure that client users are authorized to connect to the X Server.
To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:
% xhost +
To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as 'xclock':
	% <full path to xclock.. see below>
If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.

这个错误其实是要用到图形化界面才会出现的,有两种解决方法:

第一种:

最简单的,不要用远程ssh安装,直接在虚拟机的命令终端执行 ./runInstaller 命令进行安装即可

第二种:

首先切换到root用户,依次执行以下命令:

export DISPLAY=:0

xhost + 你的虚拟机ip

xhost +

然后切换到oracle用户再次执行以上命令即可

 

 

2.执行 netca 命令报错

错误信息如下:

racle Net Services 配置:
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x00007fcbedfffc2d, pid=4047, tid=140515039180608
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_17-b03 mixed mode)
# Problematic frame:
# C  [libclntsh.so.11.1+0x628c2d]  snlinGetAddrInfo+0x1b1
#
# An error report file with more information is saved as hs_err_pid4047.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
/u01/app/oracle/product/11.2.0.1/bin/netca: 行 178:  4047 已放弃               (吐核)$JRE $J

这个错误是由于没有更改、设置主机名导致的,安装linux默认的主机名一般是localhost,但是执行 netca 命令的时候不能使用localhost作为主机名,需要手动更改,错误解决如下:

首先更改主机名,输入以下命令:

hostname 新的主机名(随便设置)

例如:

hostname demoliu

 然后输入以下命令:

vim /etc/hosts

在hosts文件末尾添加以下信息:

你的虚拟机ip地址 刚才设置的主机名

例如:

172.154.20.1 demoliu

欢迎关注我的微信公众号 "抓几个娃", 一起聊聊技术和生活

以上

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值