[Java] Can't execute system command on Windows 7
I am currently maintaining a non-GUI Java application which requires the ability to pop-up a system dialog at a specified target (server).
For Linux, I can pop-up this dialog using something similar to the following command: Code:
xmessage -display <host>:0.0 <message> For Windows XP, something similar to the following is used: Code:
net send <host> <message> Code:
msg /server:<host> <user> <message> Code:
import java.io.*; Code:
java.io.IOException: Cannot run program "msg": CreateProcess error=2, The system cannot find the file specified |
Well, I found a workaround to get the application to run successfully. I had to run the application with a 64-bit version of the JRE; if I use the 32-bit version, the app does not display the message dialog. The system is configured with the 64-bit version of Win7 Ultimate.
Anybody have any ideas why Windows has to suk more? Or is this a JRE problem? |
Oh, I think that Windows has a truly unlimited capacity to "suk more" ... ;) ... :D
Seriously: as a matter of principle you need to be sure that the runtime engine you are using is recent, and well-matched to the vintage of host operating system that you are using. Although the purpose of any p-machine is to allow the p-code to be host independent, the p-machine implementation itself is decidedly not. Although I couldn't resist taking a gentle jab at Redmond, the truth of the matter is that it's not really Windows' fault. (Nor, for that matter, is it yours.) |
Quote:
|
All times are GMT -5. The time now is 02:45 AM. |