当我启动 Eclipse 4.3 时出现“无效配置位置”错误

当我启动 Eclipse 4.3 时出现“无效配置位置”错误

我第一次安装 Eclipse 4.3 (Kepler) 时,运行一切正常。我甚至还编写了一个 Java 程序。

当我关闭 Eclipse 并稍后再次运行它时,我收到以下错误消息。我认为我在安装时做错了什么,于是我卸载了它并删除了 Eclipse 的所有痕迹。然后我重新安装它,运行 Eclipse,一切正常。

它正常运行了几天。然后我关闭了电脑,几个小时后又重新启动了。Eclipse 再次给出了相同的错误消息,即无效配置位置错误。因此,Eclipse 首次运行后出现了问题,并阻止了程序的进一步执行。

当我在 Kubuntu 13.10 中运行 Eclipse (Kepler) 时,会出现此错误消息。它在 Eclipse 启动画面消失后立即出现:

**Invalid Configuration Location**
Locking is not possible in the directory "/opt/eclipse/configuration/org.eclipse.osgi". A common reason is that the file system or Runtime Environment does not support file locking for that location. Please choose a different location, or disable file locking passing "-Dosgi.locking=none" as a VM argument. 
Permission denied

所以我采纳了禁用建议,并将其放在该行后面。这是Eclipse 4.3 (Kepler) 的vmargs当前文件ini

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20130807-1835
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.locking=none
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m

但我仍然收到相同的消息。 arg-Dosgi.locking=none正在工作,因为配置文件夹中的日志文件不再提到文件锁定是一个问题。 以下是我现在在配置日志中得到的最新信息:

!SESSION 2013-11-22 22:25:06.162 -----------------------------------------------
eclipse.buildId=4.3.0.M20130911-1000
java.version=1.7.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY org.eclipse.osgi 4 0 2013-11-22 22:25:14.821
!MESSAGE Error reading configuration: Permission denied
!STACK 0
java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1006)
    at java.io.File.createTempFile(File.java:1989)
    at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:188)
    at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
    at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226)
    at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160)
    at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
    at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:263)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

!ENTRY org.eclipse.osgi 4 0 2013-11-22 22:25:14.869
!MESSAGE Startup error
!STACK 1
java.lang.RuntimeException: Permission denied
    at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:194)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:263)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1006)
    at java.io.File.createTempFile(File.java:1989)
    at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:188)
    at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
    at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226)
    at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160)
    at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
    at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
    ... 10 more

因此,剩下的一个选项是移动配置。或者可能使用-vm来指定路径,或者可能将 传递argvm

我使用位于以下位置的指南来安装 Eclipse:http://tutorialforlinux.com/2013/09/27/how-to-install-eclipse-ide-for-java-developers-ubuntu-13-04-raring13-10-saucy/

什么可能会起作用?

答案1

在我的例子中,问题通过更改相关文件的所有者得到解决,这是root出于某种原因。这会将org.eclipse.osgi目录及其所有子目录的所有者更改为config.ini

/opt/eclipse.4.3.2/configuration$ chown -R --reference config.ini org*

如果这没有帮助,请尝试添加写权限:

/opt/eclipse.4.3.2/configuration$ chmod +w org*

相关内容