Is it possible to add comments to eclipse.ini file

I wanted to comment some custom parameters I am using now, to remember why they are there the next time I edit it.

But I cannot find any reference to comments in this file. Only this, but it is pretty old and hopefully there is a way to add comments now.

Somebody knows?


Solution 1:

Comments can be marked with semicolon (;) or hash (#) (at least on Windows)

Solution 2:

Eclipse 4.5.2 on Windows 7, # is working for me. but be careful, key - value are in separate line in eclipse.ini and you need to comment out key-value in same time. I added a example.

Working

#-clean
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
-showlocation
#-vm
#C:/dev/software/jdk1.8.0_121/bin/javaw.exe
-vm
C:/dev/software/jdk1.8.0_131/bin/javaw.exe

Not working

-vm
#C:/dev/software/jdk1.8.0_121/bin/javaw.exe
C:/dev/software/jdk1.8.0_131/bin/javaw.exe

Solution 3:

A little precision on those comments in eclipse.ini, at least for Windows (7).
Strangely, using a leading "#" can result in issues with plugins management.

Here is an example with the uninstallation of one:

An error occurred while uninstalling
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]com.test.myeclipseplugins 1.2.3 --> [R]com.test.myeclipseplugins 1.2.4, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.UninstallBundleAction).
java.net.URISyntaxException: Illegal character in scheme name at index 0: %23C:/Program%20Files/Java/jdk1.8.0_92/bin/javaw.exe
java.net.URISyntaxException: Illegal character in scheme name at index 0: %23C:/Program%20Files/Java/jdk1.8.0_92/bin/javaw.exe

This "%23" character unfortunately is your leading "#".
And the only way to avoid the issue seems to just avoid using comments :(

What I do really not like in this case, is that this "#" doesn't prevent Eclipse from launching (which is the case for other "bad" characters such as ";" or "//"), but then makes other features crash with that not so evident stacktrace (when uninstalling a plugin and facing the former stack, would you first think to an issue in eclipse.ini?)