Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

passing Jvm properties (via -D) that contain spaces

I have a docker application that runs a java jar inside from the command line. I have set up the docker container to pass through "other java options", and in this case I would like to pass the following:

jdk.certpath.disabledAlgorithms=MD2, MD5, RSA keySize < 128, DSA keySize < 128, EC keySize < 128

I was hoping to be able to pass it in via -Djdk.etc but the spaces seem to really throw things off. With the spaces java complains it doesn't know what to do with the MD5 and later ("Error: Could not find or load main class MD5,". Without the spaces, I get errors about keySize< being an unknown main class.

Can someone please help me with the proper way to pass this parameter in? I have tried surrounding the whole thing in quotes yet the results are the same.

like image 631
Kevin Milner Avatar asked Jul 27 '17 16:07

Kevin Milner


1 Answers

You should surround only variable value -Dvar="a < b" works for me.

like image 159
talex Avatar answered Oct 10 '22 09:10

talex