Menu

Can't use "%" in JVM options or Environment Variables

Help
2016-04-15
2016-04-19
  • Chris Crowley

    Chris Crowley - 2016-04-15

    I think I've tried everything. I want to specify a logging format in the VM arguments. But it seems that "%"s are all blindly replaced with environment variables. For example, I want to set this:

    -Djava.util.logging.SimpleFormatter.format="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS [%4$s] %5$s%6$s%n"
    

    But all the %s get paired up and replaced with "". Thus it gets interpreted as this:

    -Djava.util.logging.SimpleFormatter.format="1$tm-1$tH:1$tS [5$sn"
    

    This is also true when creating environment variables in L4j. I've tried every sort of escaping and encoding I can think of. I could probably use a manually created environment variable, but that undermines the whole "just run it" reason for using L4j.

    Has anyone figured this out? Should I just submit a bug or feature request?

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2016-04-17

    Please submit a bug, the percentage sign cannot be escaped.

    Grzegorz

     
  • Chris Crowley

    Chris Crowley - 2016-04-19

    Done. Thanks.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.