Essayer d'expérimenter avec d'autres propriétés DYLD_ que j'ai trouvé que jvm manipule avec des propriétés et ils sont ignorés lors de l'exécution.
Mon test Java:DYLD_PRINT_LIBRARIES ne fonctionne pas
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
$
De l'autre côté, mon test C:
#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 ExPEC ted jvm test de travailler aussi, y at-il une solution de contournement?