| ScottO |
Tue Mar 18 13:35:35 GMT 2008 |
| |
Hello All, SedJ,
Was wondering if anyone in encountering the following problem.
In the DebugLogger constructor it does a exec call of "env" to get the system environment variables. This is teh exact command: p = Runtime.getRuntime().exec("env");
In the proceeding p.waitFor(), to wait till the command thread finishes, it just hangs for me. In testing other exec calls, such as cmd /c set PRIMROSE_DEBUG, or cmd /c dir, the p.waitFor returns immediately. There "env" command is not returning for me for some unknown reason. I am running Windows XP, JDK 1.6.0.5, under Eclipse. I confirmed the "env" is giving the problem by writing a small stub program and when "env" is changed to "cmd /c dir" it returns without a problem with the "dir" results
Did some poiking around and found the following UNdepricated method in Java 1.5 to get environment variables directly through the Java API instead of going to an OS level command. It is essentiall y the System.getenv() command. This is the link to the web site with the details:
http://blog.codebeach.com/2008/02/get-environment-variables-in-java.html
Think this could be incorporated in the code to see if this works? I may recompile the class with this code to see if it allows me to get past this point.
Let me know what you think.
Thanks,
Scott
|
| |
| guest |
Tue Mar 18 17:36:53 GMT 2008 |
| |
I changed the inline static code to following instead, using the System.getenv() mething for now:
static {
try {
if (System.getenv("PRIMROSE_DEBUG") != null && System.getenv("PRIMROSE_DEBUG").trim().equalsIgnoreCase("TRUE"))
DebugLogger.setEnabled(true);
} catch (Exception e) {
e.printStackTrace();
}
}
|
| sedj |
Tue Mar 18 22:33:18 GMT 2008 |
| |
Hi Scott,
Thanks for bringing this issue up. I'll have a look at what you've suggested, and see if that works for other environments.
Will let you know
Cheers |
| ScottO |
Tue Mar 18 23:10:07 GMT 2008 |
| |
Very good. Glad to help. Things are working swimmingly otherwise so far now.
- Scott |
| sedj |
Mon Mar 24 18:38:03 GMT 2008 |
| |
Hi,
We'll add this to the next release, version 3.0.12 in the next week or so.
Thanks again for bringing this to our attention.
|
|