码迷,mamicode.com
首页 > 系统相关 > 详细

Linux虚拟机里用X11协议打开图形界面的eclipse

时间:2017-07-14 19:31:23      阅读:437      评论:0      收藏:0      [点我收藏+]

标签:图形   解压   .so   output   cloc   script   warning   define   conf   

1、下载工具包

XLaunch(安装到win)
https://xming.en.softonic.com/

Eclipse IDE for C/C++ Developers(虚拟机里解压到 /datas/soft/eclipse)
https://www.eclipse.org/downloads/eclipse-packages/?osType=linux&release=undefined

jdk(虚拟机里解压到 /usr/jdk1.8.0_131)
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2、配置jdk环境变量

 1 [root@localhost ~]# vim /etc/profile #编辑如下
 2 JAVA_HOME=/usr/jdk1.8.0_131
 3 CLASSPATH=.:$JAVA_HOME/lib/tools.jar
 4 PATH=$JAVA_HOME/bin:$PATH
 5 export JAVA_HOME CLASSPATH PATH
 6 
 7 [root@localhost ~]# source /etc/profile
 8 
 9 [root@localhost ~]# java -version
10 java version "1.8.0_131"
11 Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
12 Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

3、开启X11支持

1 [root@localhost ~]# vim /etc/ssh/sshd_config #编辑如下 
2 X11Forwarding yes
3 
4 [root@localhost ~]# service sshd restart
5 
6 [root@localhost ~]# yum -y install xorg-x11-xauth
7 [root@localhost ~]# export DISPLAY=localhost:10.0

4、Xshell开启X11转发

技术分享

5、测试X11是否接通

1 [root@localhost ~]# yum -y install xclock
2 [root@localhost ~]# xclock

正常情况下可以看到如下的时钟界面,如果报错则重启虚拟机和Xshell重试

技术分享

6、启动eclipse

 1 [root@localhost ~]# cd /datas/soft/eclipse
 2 [root@localhost eclipse]# ./eclipse
 3 Eclipse:
 4 An error has occurred. See the log file
 5 /datas/soft/eclipse/configuration/1500009184940.log.
 6 [root@localhost eclipse]# cat /datas/soft/eclipse/configuration/1500009184940.log
 7 #错误片段
 8 java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
 9     /datas/soft/eclipse/configuration/org.eclipse.osgi/429/0/.cp/libswt-pi-gtk-4629.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
10     no swt-pi-gtk in java.library.path
11     /root/.swt/lib/linux/x86_64/libswt-pi-gtk-4629.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
12     Cant load library: /root/.swt/lib/linux/x86_64/libswt-pi-gtk.so
13 [root@localhost eclipse]# yum -y install gtk+*
14 [root@localhost eclipse]# ./eclipse
15 (<unknown>:2334): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type=PangoRenderFc, script=latin
16 [root@localhost eclipse]# yum -y install xorg-x11-fonts-Type1
17 [root@localhost eclipse]# ./eclipse #出现图像界面了,报错如下

技术分享

1 [root@localhost eclipse]# cat /datas/soft/eclipse/configuration/1500009612543.log
2 #错误片段
3 java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
4     /datas/soft/eclipse/configuration/org.eclipse.osgi/429/0/.cp/libswt-pi-gtk-4629.so: libXtst.so.6: cannot open shared object file: No such file or directory
5     no swt-pi-gtk in java.library.path
6     /root/.swt/lib/linux/x86_64/libswt-pi-gtk-4629.so: libXtst.so.6: cannot open shared object file: No such file or directory
7     Cant load library: /root/.swt/lib/linux/x86_64/libswt-pi-gtk.so
8 [root@localhost eclipse]# yum -y install libXtst
9 [root@localhost eclipse]# ./eclipse #成功启动

技术分享 技术分享

 

Linux虚拟机里用X11协议打开图形界面的eclipse

标签:图形   解压   .so   output   cloc   script   warning   define   conf   

原文地址:http://www.cnblogs.com/chanAndy/p/7171835.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!