Luca Tettamanti
Luca Tettamanti

Reputation: 10644

eclipse: overriding user.name in config.ini

I have a multi-user eclipse (3.4) installation with a shared master configuration area. Users need to override user.name with their full name and the usual method (adding -Duser.name=... to eclipse.ini) is not suitable since the override must be per-user. I've tried setting user.name in config.ini (inside each user's configuration directory):

user.name=Luca Tettamanti

but it does work, eclipse still retains the login name. The strange thing is that:

user.foobar=Luca Tettamanti

is correctly picked up. Is it possible to somehow override user.name in this configuration?

Upvotes: 4

Views: 20379

Answers (2)

VonC
VonC

Reputation: 1327174

This has been reported before indeed.

Why would you not use use a custom eclipse launcher (a script .cmd), which would modify the eclipse.ini, and then call eclipse.exe ?

That script could retrieve the full name with a comand like:

net user %username% /domain | find /i "full"

That way, in Windows, your custom launcher would run eclipse with:

eclipse.exe -clean --launcher.ini shared\eclipse.ini -vmargs -Duser.name=%FULL_NAME%

using the shared eclipse.ini, but specifying the user.name value.


In Linux, to relay the contents of the shell variable USER to Eclipse, you need to do this:

exec eclipse -clean --launcher.ini shared/eclipse.ini -vmargs -Duser.name=`eval "echo $USER"`

Upvotes: 3

jamesh
jamesh

Reputation: 20101

I'm a little bit unclear as to your intention.

The System property user.name is significant as it should reflect the username of who ever invoked the JVM.

If you're doing this for display purposes, and you have control of the plugin that is consuming it, then you should probably use your own method of discovering the display name.

A custom config.ini or shortcut as described by @VonC would be suitable for this.

Upvotes: 0

Related Questions