Monday, July 4, 2022

How to change user name in Eclipse code templates

 When a new code file is created, the author name in the @author is set to the value which is taken from the user.name environment variable. One way to override this value is to modify the eclipse.ini file. Following are the steps which will show you how to change user name in Eclipse code templates.

Navigate to the location of eclipse.ini file on your system (a file search will reveal its location). Add the following parameter to the list of the Virtual Machine arguments in the eclipse.ini file.

How to change user name in Eclipse code templates
eclipse.ini
-vmargs ... ... ... -Duser.name=Your name

Make sure to add this user name argument after the -vmargs command and also don't forget to restart Eclipse after making this change. After this change, wherever the ${user} variable is used, it will be replaced with the user name entered in the eclipse.ini file.

How to change user name in Eclipse code templates

No comments: