Linux中eclipse安装遇到的问题
- eclipse解压后,在eclipse安装目录下./eclipse启动时报错
[hadoop@hadoop02 eclipse]$ ./eclipse
错误信息如下:
***WARNING: Gtk+ version too old (micro mismatch)
***WARNING: SWT requires GTK 2.24.0
***WARNING: Detected: 2.18.9
***WARNING: SWT requires Cairo 1.9.4 or newer
***WARNING: Detected: 1.8.8
/home/hadoop/app/eclipse/eclipse: symbol lookup error: /home/hadoop/app/eclipse/configuration/org.eclipse.osgi/454/0/.cp/libswt-pi-gtk-4919.so: undefined symbol: g_bus_own_name
查看日志信息报如下错误
!SESSION 2018-09-20 02:37:15.952 -----------------------------------------------
eclipse.buildId=4.9.0.I20180906-0745
java.version=1.8.0_181
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.committers.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.committers.product
!ENTRY org.eclipse.osgi 4 0 2018-09-20 02:37:24.728
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(SWT.java:4621)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:1038)
at org.eclipse.swt.widgets.Display.create(Display.java:1025)
at org.eclipse.swt.graphics.Device.<init>(Device.java:179)
at org.eclipse.swt.widgets.Display.<init>(Display.java:590)
at org.eclipse.swt.widgets.Display.<init>(Display.java:581)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:749)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:163)
at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:185)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:128)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:199)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:391)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
解决方法:
sudo yum install gtk
[hadoop@hadoop02 ~]$ sudo yum install gtk
报错:
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.shu.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.163.com
Setting up Install Process
No package gtk available.
Error: Nothing to do
解决此错误参考:https://blog.csdn.net/dongxie_tk/article/details/77639559
解决方法:
fastestmirror是yum的一个加速插件,这里是插件提示信息是插件不能用了。
不能用就先别用呗,禁用掉,先yum了再说。
① .修改插件的配置文件
# vi /etc/yum/pluginconf.d/fastestmirror.conf
enabled = 1//由1改为0,禁用该插件
...............................
②. 修改yum的配置文件
# vi /etc/yum.conf
.........................
plugins=1//改为0,不使用插件
根据上边步骤修改完后,再次执行 sudo yum install gtk
报如下错误:
Setting up Install Process
No package gtk available.
Error: Nothing to do
解决方法:
sudo yum -y update更新一下yum仓库,
再次运行安装,如果发现错误依旧,看来这种猜包名的方法不适用;所以接下来可以通过yum的查找参数来列出vim相关的包名:
[root@malu2 yum.repos.d]# yum search gtk
下边会列出详细的gtk相关的包名,这样就可以顺利的安装gtk了:
例如:yum -y install 包名
启动eclipse 打开class 闪退,报错误
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
***WARNING: SWT requires Cairo 1.9.4 or newer
***WARNING: Detected: 1.8.8
org.eclipse.m2e.logback.configuration: Logback config file: /home/hadoop/app/eclipse-workspaceNew/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.9.1.20180912-1601.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://509.fwk31743879:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://509.fwk31743879:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
log4j:WARN No appenders could be found for logger (org.apache.commons.httpclient.params.DefaultHttpParams).
log4j:WARN Please initialize the log4j system properly.
eclipse: cairo-misc.c:380: _cairo_operator_bounded_by_source: Assertion `NOT_REACHED' failed.
Aborted (core dumped)
cairo-misc.c:380 错误请参考: https://blog.csdn.net/nicolewjt/article/details/82866246 错误已解决