How to reference a JVM variable in eclipse.ini

别说谁变了你拦得住时间么 提交于 2019-12-11 16:03:15

问题


I would like to specify a custom value for java.io.tmpdir in eclipse.ini file. Specifically, I need to have a username as part of the path.

I see the following entry in my eclipse.ini:

-Dosgi.instance.area.default=@user.home/eclipse-workspace

But when I try to use similar lines for my purpose:

-Djava.io.tmpdir=/tmp/eclipse_@user.name
-Djava.io.tmpdir=/tmp/eclipse_{@user.name}
-Djava.io.tmpdir=/tmp/eclipse_@{user.name}
-Djava.io.tmpdir=/tmp/@user.name

I end up with the following directories (literally):

/tmp/eclipse_@user.name
/tmp/eclipse_{@user.name}
/tmp/eclipse_@{user.name}
/tmp/@user.name

How could I specify my -D option so that @user.name is substituted with the actual username (e.g., john_doe)?


回答1:


The eclipse.ini does not support variable substitution.

The @user.home and @user.dir substitution is done by the Equinox location code and consequently is only supported for the Equinox location values which are:

osgi.install.area
osgi.configuration.area
osgi.configuration.area.default
osgi.instance.area
osgi.instance.area.default
osgi.user.area
osgi.user.area.default

The code that does this is org.eclipse.osgi.internal.location.EquinoxLocations



来源:https://stackoverflow.com/questions/51322680/how-to-reference-a-jvm-variable-in-eclipse-ini

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!