java.lang.IllegalStateException:设置后无法更改位置

时间:2013-09-25 06:20:46

标签: java eclipse

每当我尝试启动我的应用程序(基于Eclipse)时,它都会给我以下错误

java.lang.IllegalStateException: Cannot change the location once it is set.
    at org.eclipse.core.runtime.internal.adaptor.BasicLocation.set(BasicLocation.java:142)
    at org.eclipse.core.runtime.internal.adaptor.BasicLocation.set(BasicLocation.java:137)
    at com.fiorano.studio.fmq.rcp.Application.start(Application.java:90)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    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:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

它要求我提供工作空间。当我选择一个并做'确定'时。它只是关闭并抛出异常。我用Google搜索但没有太多文档。以前有人遇到过这个问题吗?

1 个答案:

答案 0 :(得分:0)

我搜索了一下,发现你需要在运行时配置中添加 @noDefault 。但它已经在我的.ini文件中了。问题如下 -

我的配置文件如下

--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.v20110505
-showsplash
-showlocation
-data
–vm
/home/aniket/jdk1.7.0_11/bin
@noDefault
-vmargs
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-Dosgi.requiredJavaVersion=1.5

我把它改成了

--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.v20110505
-showsplash
-showlocation
-data
@noDefault
–vm
/home/aniket/jdk1.7.0_11/bin
-vmargs
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-Dosgi.requiredJavaVersion=1.5

并且它有效。我的事情@noDefault必须在-showsplash -showlocation -data之后并且在指定

之前
–vm
/home/aniket/jdk1.7.0_11/bin

我知道这听起来有点傻,我不确定原因,但希望如果有人再次面对这种情况,这会有所帮助。