歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 14.04 下Eclipse 3.7.2 無法啟動解決

Ubuntu 14.04 下Eclipse 3.7.2 無法啟動解決

日期:2017/2/28 14:23:47   编辑:Linux教程

解決Ubuntu 14.04 下Eclipse 3.7.2 不能啟動,報Could not detect registered XULRunner to use 或 org.eclipse.swt.SWTError: XPCOM 等問題的處理。

對於eclipse 3.7.2在ubuntu 14.04下不能啟動,需要在

eclipse/configuration 目錄下的config.ini文件內增加一行org.eclipse.swt.browser.DefaultType=mozilla


#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Thu Jan 15 11:18:24 CST 2015
org.eclipse.update.reconcile=false
eclipse.p2.profile=epp.package.jee
[email protected]/workspace
osgi.framework=file\:plugins/org.eclipse.osgi_3.7.2.v20120110-1415.jar
equinox.use.ds=true
eclipse.buildId=M20120208-0800
org.eclipse.swt.browser.DefaultType=mozilla
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.200.v20110815-1438.jar@1\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
eclipse.product=org.eclipse.platform.ide
osgi.splashPath=platform\:/base/plugins/org.eclipse.platform
osgi.framework.extensions=reference\:file\:javax.transaction_1.1.1.v201105210645.jar
osgi.bundles.defaultStartLevel=4
[email protected]/../p2/
eclipse.application=org.eclipse.ui.ide.workbench

這樣啟動就不會報錯了 這是我google出來的 我不能說明原因。

能啟動之後 當你點擊內嵌的浏覽器 或者 webservie 浏覽器時 不是報錯 沒有反映 就是在當前窗體外啟動了外部浏覽器

另外編輯jsp時報錯 Could not detect registered XULRunner to use

這些都是因為為eclipse 的內嵌浏覽器 沒有生效。

我們應該這樣做

對一eclipse 3.7.2 版本

請去http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2012/03/2012-03-02-03-32-11-mozilla-1.9.2/xulrunner-1.9.2.28pre.en-US.linux-x86_64.tar.bz2

下載xulrunner-1.9.2.28pre.en-US.linux-x86_64.tar.bz2

解壓到一個合適的問題 比如我解壓到了 /opt/commonTools/下 在/opt/commonTools/下就有一個xulrunner目錄。

tone@ubuntu:/opt/commonTools$ ls -l
總用量 43176
drwxrwxr-x 13 tone tone 4096 12月 20 12:35 Android-sdk-linux
drwxr-xr-x 6 root root 4096 11月 17 11:08 apache-ant-1.9.3
drwxr-xr-x 7 root root 4096 11月 17 10:30 apache-maven-3.2.2
drwxr-xr-x 9 root root 4096 10月 9 2009 jdk1.5.0_22
-rwxr-xr-x 1 root root 44191305 1月 13 16:16 jdk-1_5_0_22-linux-amd64.bin
drwxr-xr-x 11 root root 4096 3月 2 2012 xulrunner

接下來邊界eclipse的配置文件。eclipse.ini 增加一行-Dorg.eclipse.swt.browser.XULRunnerPath=/opt/commonTools/xulrunner

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.v20110505
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Djava.library.path=/usr/lib/x86_64-linux-gnu/jni
-Dorg.eclipse.swt.browser.XULRunnerPath=/opt/commonTools/xulrunner
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m

經過以上的錯誤 你的eclipse 和諧了,效果如下:

針對Could not detect registered XULRunner to use 或 org.eclipse.swt.SWTError: XPCOM 的解決辦法(安裝XULRunner) 針對最新的myeclipse 2014 依然有效

--------------------------------------分割線 --------------------------------------

Ubuntu 14.04 LTS安裝Java 8和Eclipse 4.4 http://www.linuxidc.com/Linux/2014-11/109217.htm

Hadoop Eclipse 插件編譯安裝1.2.0 http://www.linuxidc.com/Linux/2013-07/87428.htm

Hadoop在Eclipse中的插件編譯 http://www.linuxidc.com/Linux/2013-04/83295.htm

Hadoop 1.2.1編譯Eclipse插件 http://www.linuxidc.com/Linux/2013-10/91666.htm

Ubuntu 13.10安裝JDK、Eclipse for C/C++(解決全局菜單問題) http://www.linuxidc.com/Linux/2013-11/92305.htm

如何在Ubuntu 14.04中安裝最新版Eclipse http://www.linuxidc.com/Linux/2014-08/105090.htm

--------------------------------------分割線 --------------------------------------

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

Copyright © Linux教程網 All Rights Reserved