Trying to experiment with other DYLD_ properties I've found that jvm is manipulating with properties and they are ignored during execution.
My Java test:
class Env {
public static void main(String... args) {
System.getenv().entrySet().stream().forEach(e -> System.out.println(e.getKey() + " = " + e.getValue()));
}
}
Invocation:
$ export DYLD_PRINT_LIBRARIES=1
$ export MY_PRINT_LIBRARIES=2
$ javac Env.java && java Env|grep PRINT
MY_PRINT_LIBRARIES = 2
$
On the other side, my C test:
#include <stdio.h>
int main(int argc, char **argv, char **envp) {
while (*envp) {
printf("%s\n", *envp);
envp++;
}
return 0;
}
Invocation:
$ gcc env.c && ./a.out|grep PRINT
dyld: loaded: /Users/okutane/test/java/./a.out
dyld: loaded: /usr/lib/libSystem.B.dylib
dyld: loaded: /usr/lib/system/libcache.dylib
...
dyld: loaded: /usr/lib/libc++.1.dylib
dyld: loaded: /usr/lib/libDiagnosticMessagesClient.dylib
MY_PRINT_LIBRARIES=2
DYLD_PRINT_LIBRARIES=1
$
I expected jvm test to work too, is there are any workaround?