How to use a Windows filename with a colon with Java 9 unified logging?

user335958 :
% java11 -Xlog:gc*:file=c:\max.txt -version
[0.002s][error][logging] Invalid decorator '\max.txt'.
Invalid -Xlog option '-Xlog:gc*:file=c:\max.txt', see error log for 
details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Apparently with Java 9 (and later) unified logging a colon is used as a separator between fields in the -Xlog arguments. So, how do I specify a Windows pathname that has a colon in it? Is there an escape of some kind? If I specify the filename as is, I get the error I included above. Thank you.

Naman :

One of the ways suggested for solving that on the mailing list is using shell escapes like:

java -Xlog:gc*:file=\"C:\max.txt\" -version

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=107273&siteId=1