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

前端 未结 1 1160
無奈伤痛
無奈伤痛 2021-01-14 01:33
% 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         


        
相关标签:
1条回答
  • 2021-01-14 01:48

    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
    

    Note that according to Dave Holmes' posting, only double quotes are supported. Depending on the shell, the escaping is necessary so that the Java command sees the quotes.

    0 讨论(0)
提交回复
热议问题