Saturday, April 21, 2007


Yesterday a tried to see what happens if I set _JAVA_LAUNCHER_DEBUG environment varable. So, I have set _JAVA_LAUNCHER_DEBUG=true, and started an application...
In Cygwin, for instance:

ant@jupiter ~
$ export _JAVA_LAUNCHER_DEBUG=true

ant@jupiter ~
$ java -version
JRE path is c:\jdk1.5.0_11\jre
jvm.cfg[0] = ->-client<-
jvm.cfg[1] = ->-server<-
jvm.cfg[2] = ->-hotspot<-
name: -hotspot vmType: VM_ALIASED_TO alias: -client
jvm.cfg[3] = ->-classic<-
jvm.cfg[4] = ->-native<-
jvm.cfg[5] = ->-green<-
1530 micro seconds to parse jvm.cfg
Default VM: client
JVM path is c:\jdk1.5.0_11\jre\bin\client\jvm.dll
6299 micro seconds to LoadJavaVM
JavaVM args:
version 0x00010002, ignoreUnrecognized is JNI_FALSE, nOptions is 2
option[ 0] = '-Djava.class.path=.;C:\Program Files\Java\jre1.6.0\lib\ext\'
option[ 1] = ''
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)

OK, nice, it works... I have set _JAVA_LAUNCHER_DEBUG=false and continued with my work.

In a few minutes I wanted to compile some application using IntelliJ IDEA, but as the compilation process stared the IDE just hanged and did nothing. Restarting the IDE didn't help. Confused! I've reinstalled IDEA, upgraded to a new version even - nothing helped - it just hanged when I tried to compile anything.

Damn! I memorized now about the environment variable I've set. Removed that. IDEA compilation succeeded.

The moral is that JVM doesn't care which value is set to _JAVA_LAUNCHER_DEBUG: either 'true' or 'false'. It could be 'foo', 'bar' or 'John Doe' as well - JVM requires this environment variable to be set for debugging and doesn't need the value at all.

No comments:

Disqus for Code Impossible