Java 启动 Eclipse 时出现“无法获取应用程序服务”错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2493415/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"Unable to acquire application service" error while launching Eclipse
提问by GuruKulki
When ever I try to launch my eclipse I am getting the following exception an its not coming up.
每当我尝试启动我的 Eclipse 时,我都会收到以下异常,并且没有出现。
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Need help. Thanks.
需要帮忙。谢谢。
采纳答案by BalusC
The /configuration/config.ini
file should contain org.eclipse.core.runtime@start
in the commaseparated osgi.bundles
property. Here is the default osgi.bundles
property, maybe it was (accidently) changed during some upgrade:
该/configuration/config.ini
文件应包含org.eclipse.core.runtime@start
在逗号分隔的osgi.bundles
属性中。这是默认osgi.bundles
属性,可能在某些升级过程中(意外)更改了:
osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start
You can if necessary override it by setting it as VM argument in /eclipse.ini
:
如有必要,您可以通过将其设置为 VM 参数来覆盖它/eclipse.ini
:
-Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start
回答by medopal
try running it from the Command Line as:
尝试从命令行运行它:
>eclipse -clean
Or, you could run it using java
instead of the default javaw
, here:
或者,您可以在此处使用java
而不是默认值来运行它javaw
:
>eclipse -vm c:\jdks\java_1.5\jre\bin\java.exe
回答by Sandman
I have had the same problem, and here's how I solved it: I added the plugin "org.eclipse.core.runtime" in the "plugins" section on the "configuration" tab of the .product editor. I set it's start level to default and auto-start to true. I removed other plugins. My reasoning was this: Eclipse is complaining that the org.eclipse.core.runtime isn't started, so let's make sure that it does start, and that it's the only plugin that's starting.
我遇到了同样的问题,这是我解决它的方法:我在 .product 编辑器的“配置”选项卡上的“插件”部分中添加了插件“org.eclipse.core.runtime”。我将它的启动级别设置为默认值并将自动启动设置为 true。我删除了其他插件。我的推理是这样的:Eclipse 抱怨 org.eclipse.core.runtime 没有启动,所以让我们确保它启动了,并且它是唯一启动的插件。
My application ran fine after I did this. I then inspected the config.ini to see what changed, and saw that org.eclipse.core.runtime was now changed to org.eclipse.core.runtime@start. This is consistent with BalusC's suggestion, I just did it from the .product editor.
执行此操作后,我的应用程序运行良好。然后我检查了 config.ini 以查看发生了什么变化,并看到 org.eclipse.core.runtime 现在已更改为 org.eclipse.core.runtime@start。这与 BalusC 的建议一致,我只是从 .product 编辑器中完成的。
回答by Nick
The accepted answer above is correct, except for it's not completely clear.
上面接受的答案是正确的,只是不完全清楚。
You need to add the following line to the bottom of the eclipse.ini file:
您需要将以下行添加到 eclipse.ini 文件的底部:
-Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@
回答by evandor
Adding my two cents for those searching for "Ensure that the org.eclipse.core.runtime bundle is resolved and started":
为那些搜索“确保 org.eclipse.core.runtime 包已解析并启动”的人添加我的两分钱:
Adding "arbitrary" bundles to the list of bundles just because it seems that they are missingis not always the best solution. Sometimes it can get quite frustrating, because those new plugins might depend on other missing bundles, which need even more bundles and so on...
仅仅因为似乎缺少它们而将“任意”包添加到包列表中并不总是最好的解决方案。有时它会变得非常令人沮丧,因为这些新插件可能依赖于其他缺少的包,这些包需要更多的包等等......
So, before adding a new dependency to the list of required bundles, make sure you understand why the bundle is needed (the debugger is your friend!).
因此,在向所需包列表添加新依赖项之前,请确保您了解需要该包的原因(调试器是您的朋友!)。
This question here doesn't provide enough information to make this a valid answer in all cases, but if you encounter the message that the org.eclipse.core.runtime is missing, try setting the eclipse.application.launchDefaultsystem property to false, especially if you try to run an application which is not an "eclipse application" (but maybe just a headless runtime on top of equinox).
这里的这个问题没有提供足够的信息来使它在所有情况下都是有效的答案,但是如果您遇到org.eclipse.core.runtime is missing的消息,请尝试将eclipse.application.launchDefault系统属性设置为false,特别是如果您尝试运行不是“eclipse 应用程序”的应用程序(但可能只是 equinox 之上的无头运行时)。
This link might come in handy: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html, look for the eclipse.application.launchDefault system property.
这个链接可能会派上用场:http: //help.eclipse.org/indigo/index.jsp?topic=% 2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html,寻找日食.application.launchDefault 系统属性。
回答by Ricardo Rivaldo
I got this problem with Mac OS Lion, after transfer OS/Data from an older machine to a new one.
在将操作系统/数据从旧机器转移到新机器后,我在 Mac OS Lion 上遇到了这个问题。
Solved deleting the old eclipse folder (which I have in Applications folder) and copy eclipse folder again (same version, same unpacked zip file, no changes).
解决了删除旧的 eclipse 文件夹(我在 Applications 文件夹中)并再次复制 eclipse 文件夹(相同版本,相同解压缩的 zip 文件,没有更改)。
回答by LuisF
I've been downloaded the "SDK ADT Bundle for Windows" adt-bundle-windows-x86.zip to "Documents and settings\myusername\My Documents\Downloads" and tried to unzip to a folder c:\Android
我已经将“SDK ADT Bundle for Windows”adt-bundle-windows-x86.zip 下载到“Documents and settings\myusername\My Documents\Downloads”并尝试解压到文件夹 c:\Android
When all seems to be decompressed I saw some files where missing in the destination folder including the eclipse.ini.
当所有似乎都被解压缩时,我看到目标文件夹中缺少一些文件,包括 eclipse.ini。
I solved this by renaming adt-bundle-windows-x86.zip
to a short name adt.zip
, moving it to c:\ and repeating the decompression.
我通过重命名adt-bundle-windows-x86.zip
为短名称adt.zip
,将其移动到 c:\ 并重复解压来解决此问题。
All is due to bad treatment of long file-names in windows
一切都是由于 Windows 中对长文件名的处理不当造成的
回答by Joshua Drake
For those coming here having tried to run the application from a Windows command line, or batch file, and possibly those receiving the stated error message in a Rational Clear Case log file:
对于那些试图从 Windows 命令行或批处理文件运行应用程序的人,以及可能在 Rational Clear Case 日志文件中收到所述错误消息的人:
The PATH is very important to the processing of config files, and the following was required for me:
PATH 对于配置文件的处理非常重要,我需要以下内容:
START "Clear Case" /D"C:\Program Files (x86)\Rational\ClearQuest\rcp\" "C:\Program Files (x86)\Rational\ClearQuest\rcp\clearquest.exe"
note the /Doption.
注意/D选项。
回答by Joshua Goldberg
Adding to a well-populated page:
添加到填充良好的页面:
I had this come up when I tried to move the eclipse installation to a different location on my drive. I tried grepping for the old directory path in the package, thinking perhaps I could fix it with sed, but the path was written in multiple formats and even found in binary files. I gave up, made a fresh install, and re-installed my plugins.
当我尝试将 eclipse 安装移动到驱动器上的其他位置时,我遇到了这个问题。我尝试搜索包中的旧目录路径,想也许我可以用 sed 修复它,但该路径是以多种格式编写的,甚至在二进制文件中也能找到。我放弃了,重新安装并重新安装了我的插件。
(Here's a question about moving an eclipse installation, but it didn't give me enough to make it work.)
(这是一个关于移动 eclipse 安装的问题,但它没有给我足够的时间来使它工作。)
回答by shawn
This error happen cause you deleted the config.ini file while you deleted the plugins. So, when it can not find configuration in config.ini when eclipse lauching, then it use default configuration which is not fit with your os. The following steps solve you problem:
发生此错误是因为您在删除插件时删除了 config.ini 文件。所以,当eclipse启动时在config.ini中找不到配置时,就会使用不适合你的操作系统的默认配置。以下步骤可以解决您的问题:
Delete setting in configuration folder.
create a new config.ini file.
copy following setting and save:
osgi.splashPath = platform:/base/plugins/org.eclipse.platform osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start, org.eclipse.core.runtime@start eclipse.product=org.eclipse.sdk.ide [email protected]/workspace eof=eof
restart eclipse.
删除配置文件夹中的设置。
创建一个新的 config.ini 文件。
复制以下设置并保存:
osgi.splashPath = platform:/base/plugins/org.eclipse.platform osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start, org.eclipse.core.runtime@start eclipse.product=org.eclipse.sdk.ide [email protected]/workspace eof=eof
重启日食。