简言之,我的问题是:
我想用一个特定的配置.ini文件是什么
在默认目录中,即
不
../eclipse/configuration/config.ini
但同时我希望配置区域位于不同的位置,用户主目录。
原因与使用几种不同的方法有关配置.ini文件和保存文件的配置区域是只读的。
启动工具时
${JAVA_HOME}/bin/java
-Dosgi.baseConfiguration.area=$INSTALLATION/$CONFIGURATION/eclipse/configuration\
-jar $INSTALLATION/eclipse/plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar \
在我的脑海里配置.ini(除其他事项外):
osgi.configuration.area=@user.home/tmp/eclipse_data/
我几乎得到了我想要的一切:对的配置.ini当使用文件时,该工具开始将数据缓存到正确的位置,并且只在那里。但有一点缺点,就是工具无法启动。。。我收到错误消息:
!ENTRY org.eclipse.osgi 4 0 2010-11-29 19:17:06.914
!MESSAGE Application error
!STACK 1
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:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
如果我改成
${JAVA_HOME}/bin/java -Dawt.toolkit=sun.awt.X11.XToolkit \
-Dosgi.configuration.area=$INSTALLATION/$CONFIGURATION/eclipse/configuration \
-jar $INSTALLATION/eclipse/plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar \
该工具可以工作,但开始将数据保存到我的writeprotected区域。
在我的应用程序中,这不是捆绑包定义的问题配置.ini文件,因为它们在第二个场景中工作。
有几个解决办法,但首先我要看看是否有一种方法,使这项工作,我们想首先。
更新:
org.eclipse.osgi_3.6.0.v20100517
. 当我在中检查eclipse代码时
grepcode
这引发了一个异常我发现了这行:
if (failOnNoDefault && runnable == null)
throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_NO_APPLICATION);
所以我的runnable是空的。不知道为什么,但我认为这是一个迹象,我必须使用一些变通办法。