ubuntu启动eclipse时出错cannot open display
由于要学习hadoop,就在ubuntu下创建了一个hadoop用户,但是eclipse是在naomi用户下装的,在root和naomi用户下都能正常启动,但是一旦切换到hadoop用户,试着启动eclipse,就会cannot open display, no protocol specify
打开日志文件后的信息为
org.eclipse.swt.SWTError: No more handles[gtk_init_check() failed]
原因:
当使用su 到另外一个用户运行某个程序,而这个程序又要有图形显示的时候,就有可能有下面提示:
No protocol specified
(gedit:14333): Gtk-WARNING **: cannot opendisplay: :0.0
这是因为Xserver默认情况下不允许别的用户的图形程序的图形显示在当前屏幕上. 如果需要别的用户的图形显示在当前屏幕上, 则应以当前登陆的用户, 也就是切换身份前的用户(不是hadoop用户,是root用户)执行如下命令。
xhost +(别忘了空格)
通过执行这条命令,就授予了其它用户访问当前屏幕的权限,于是就可以以另外的用户运行需要运行的程序了
本文参考:http://java-doom.iteye.com/blog/1738370
ubuntu启动eclipse时出错cannot open display的更多相关文章
- Ubuntu启动eclipse问题
Ubuntu启动eclipse问题 在Ubuntu安装eclipse后 可以在终端顺利启动eclipse:进入eclipse目录,在终端输入命令 ./eclipse > /dev/null 2& ...
- 启动Eclipse时,启不起来JVM terminated. Exit code=-1
启动Eclipse时,启不起来JVM terminated. Exit code=-1 出现错误了,不知道什么原因原本好好的Eclipse,今天早上出问题了,启动不起来还抛出JVM terminate ...
- 启动eclipse时出现“Failed to load the JNI shared library jvm.dll”错误及解决-及eclipse版本查看
启动eclipse时出现“Failed to load the JNI shared library jvm.dll”错误及解决-及eclipse版本查看 学习了:https://www.cnblog ...
- Python开发环境(2):启动Eclipse时检测到PYTHONPATH发生改变
OS:Windows 10家庭中文版,Eclipse:Oxygen.1a Release (4.7.1a),PyDev:6.3.2 4月25日,在Eclipse上安装了PyDev(前面博文有记录),并 ...
- 启动Eclipse时,弹出JVM terminated. Exit code=127..错误的解决方案
在Linux环境下,启动Eclipse,会弹出并报如下的错误,且不能启动该工具 JVM terminated. Exit code=127/eclipse/jdk1.7.0_71/bin/java-D ...
- 启动eclipse时出现“Failed to load the JNI shared library jvm.dll”错误及解决
昨晚安装另一个版本的eclipse,启动时出现了"Failed to load the JNI shared library jvm.dll"错误: 1.刚开始以为是因为当时没有将 ...
- 使用脚本启动fabric时出错
Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating ReadSet: rea ...
- 启动eclipse时:java is started but returned code 13
此问题是eclipse位数和java位数不匹配造成的 我的是win10 64位的eclipse + 32位的java造成的问题 查看eclipse位数:用记事本打开eclipse根目录下的eclips ...
- 启动Eclipse时An internal error occurred during: "Initializing Java Tooling".错误
解决方法一 重置窗口布局: windows > perspective > reset perspective 解决方法二: 如果上述方法不好使,采用下面的这种方法: 删除workspac ...
随机推荐
- 6、android开发中遇到的bug整理
1.使用actionProvider时出现的问题 bug复现: 解决方案: //import android.support.v4.view.ActionProvider; import androi ...
- Ombrophobic Bovines - POJ 2391
Description FJ's cows really hate getting wet so much that the mere thought of getting caught in the ...
- CentOS 6.5下Git服务器搭建
1 . Git服务器搭建 1. 环境部署 系统环境:服务器端:CentOS 6.5 ,ip:192.168.56.1 客户端:CentOS 6.5 ,ip:192.168.56.101 软件版本:服务 ...
- jquery $.ajax方法
$.ajax({ timeout: 3000, cache:false, global:false, type: "POST", url: WEB_URL+"/logic ...
- yield curve
1. A yield curve can be built using deposit rates, swap rates, and future/forward rates 2. A par-cou ...
- [工作积累] jboolean is neither JNI_TRUE nor JNI_FALSE
jboolean result = env->CallBooleanMethod(ShopDataAndroid.IAPBridge_Object, ShopDataAndroid.IAPBri ...
- [百度空间] [转]将程序移植到64位Windows
from : http://goooder.bokee.com/2000373.html (雷立辉 整理) 简介:本文对如何将32位Windows程序平滑的支持和过渡到64位Windows操作系统做出 ...
- CentOS 有gcc没有g++
[root@localhost ~]# which gcc/usr/bin/gcc[root@localhost ~]# which g++/usr/bin/which: no g++ in (/us ...
- KMP_Best Reward
大意:把一个字符串分成两串,假如一个字符串是回文串就可以加上它的VALUE,否则它的VALUE为0: KMP的特点是可以求出前缀与后面的字符串是否匹配, 注意回文串的特点,所以当我们把回文串反转的时候 ...
- JavaScript 文件上传类型判断
文件上传时用到一个功能,使用html元素的input标签实现, <input id="imageFile" name="imageFile1" accep ...