Can we have multiline comments in a Java properties file?

I have made a class that handles comments in properties. Both general header comments and comments for individual properties.

Have a look at : CommentedProperties JavaDoc

The jar file can be downloaded here : Download jar file from sourceforge


If you use Eclipse, you can select multiple lines and comment all with a shortcut (Ctrl+/ by default). Same shortcut uncomments the lines, but you have to pay attention no to select any empty line, which will cause the non-empty ones to get commented more than once.

These apply to Eclipse, but I guess many IDE:s and some editors offer similar functionality.


.properties files do not have multiline comments.

Since JDK 1.5 Properties have XML support, and XML format supports multiline comments. See javadocs.


Unfortunately not! Java properties file only have single line # comments.