Fork me on GitHub
#clj-on-windows
<
2022-11-04
>
chaos19:11:08

Hi, just so that you are aware of yet another quoting hassle, I submitted a bug report to Oracle with regards to a differences in behavior I've noticed when passing in double escaped quoted arguments to the java executable on MS-Windows. This bug makes quoting inconsistent when passing quoted command line arguments to the actual se/jdk java.exe executable vs. passing arguments to the proxy java.exe program commonly installed at C:\Program Files\Common Files\Oracle\Java\javapath . It is the latter that is usually added to the PATH and its job is to call the actual jdk java.exe executable last installed on the user's PC. Here is an example below of the inconsistent behavior when passing arguments down to a toy PrintArgs program which just prints out the arguments received:

Running this using the javapath/java.exe (the numbers represent the depth of the embedded quotes):
"C:\Program Files\Common Files\Oracle\Java\javapath\java.exe" PrintArgs "0\"1\\\"2\\\"1\"0"

gives back

0"1\2\1"0

while running them with java from the jdk directoy, 
"C:\Program Files\Java\jdk-17.0.5\bin\java.exe" PrintArgs "0\"1\\\"2\\\"1\"0"

gives back

0"1\"2\"1"0

as expected.
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8296383

borkdude19:11:36

Thanks for filing the bug. I think @U0ETXRFEW also once posted a bug to Oracle concerning a difference between Java versions but it may also have been this one

chaos19:11:13

(Just to clarify in case it wasn't clear, this is a bug affecting all jdk/se versions. The error is with the java.exe proxy installed in Java/javapath whose job is to call the actual jdk java.exe installed somewhere else in the System 🙂 )

pez23:11:58

The bug I reported was also with the java.exe proxy. https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8266473 That one is fixed, as far as I understand.

chaos02:11:06

Well done @U0ETXRFEW, your bug report is what I based mine on and it was linked as such. It is the same issue but with double or more escaped quotes .

🙏 1