Since you're OK with doing brain surgery on the JDK and you control the entire process, consider controlling your daemon with a bytecode rewriting agent (e.g. byteman) that changes the definition of System.getenv etc. (Whose side are you on Martin?! ... I confess I also wish for a faster gradle ...)