Hi Rajym,
Is that Environment Variables (i.e JAVA_HOME) you refered as global variables?
Netbeans usualy reads its default values from the following file:
<YOUR_NETBEANS_HOME>\etc\netbeans.conf
This file contais all default configuration values used by netbeans at the time of boostraping. Ta variable called 'netbeans_jdkhome' in this file that you can define the jdk directory you want to work with netbeans.
Perhaps this may give you some hint to solve your problem.
Cheers!
Jini