Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Application error if SystemRoot env variable is not properly on Win platform (http://www.go4expert.com/forums/application-error-systemroot-env-t22842/)

prasanta123 28Jul2010 15:44

Application error if SystemRoot env variable is not properly on Win platform
 
Hi all

By default SystemRoot is set by windows OS and all processes inherits environment from the parent process (i.e. SystemRoot is set properly).

However if you configure your environment for a process ):
java.lang.Runtime.exec(String[] cmdarray, String[] envp);
Then if cmdarray = new String[]{"..../cvm.exe"....}; and envp massive does not have string "SystemRoot=C:\WINDOWS".
You will get application error:
"The application failed to initialize properly (0xc0150004). Click on OK to terminate the application."

Can anyone please suggest (please point to some documentation/site) if it is a must to specify "SystemRoot=C:\WINDOWS" in envp & if it is valid to get this application error
or if it is a bug in our code?

Regards
Prasanta


All times are GMT +5.5. The time now is 23:09.