I am trying to create gc log in java 11 in the folder which does not exist.xxx folder does not exists.
C:\>java -Xlog:gc*:file=C:\Users\xxx\gc.log --version
[0.006s][error][logging] Error opening log file 'C:\Users\xxx\gc.log': No such file or directory
[0.006s][error][logging] Initialization of output 'file=C:\Users\xxx\gc.log' using options '(null)' failed.
Invalid -Xlog option '-Xlog:gc*:file=C:\Users\xxx\gc.log', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
How to get the gc logs in a folder which does not exist?
If the folder exists, it works fine.
java -version
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)