如何在eclipse.ini中引用JVM变量 [英] How to reference a JVM variable in eclipse.ini
问题描述
我想在 eclipse.ini
文件中为 java.io.tmpdir
指定一个自定义值.具体来说,我需要将用户名作为路径的一部分.
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.
我在 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
如何指定我的 -D
选项,以将 @ user.name
替换为实际的用户名(例如, john_doe
)?
How could I specify my -D
option so that @user.name
is substituted with the actual username (e.g., john_doe
)?
推荐答案
eclipse.ini不支持变量替换.
The eclipse.ini does not support variable substitution.
@ user.home
和 @ user.dir
替换是由Equinox位置代码完成的,因此仅受以下Equinox位置值支持:>
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
执行此操作的代码是 org.eclipse.osgi.internal.location.EquinoxLocations
这篇关于如何在eclipse.ini中引用JVM变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!