Runtime.exec problems
Hi, I have several applications which all depend on a client side Derby database server. The db just runs in the background with a system tray icon. Any one of my applications can be started and then checks to see if the db is there, and if not it starts the server (using Runtime.exec). Then when an app is closed, the server stays in the system tray for other appliations that may need it.
The problem is that when I close an application, it does not exit until the server process exits! This is not what I want to happen. I want the server to be a completely seperate process that can run across the life times of many applications.
I am almost certain this didn't happen in Java 5. I am using the latest Java 6 update 2 right now. I made a simple test case:
publicclass ExecTest{
publicstaticvoid main(String[] args)throws Exception{
Runtime.getRuntime().exec(new String[]{"C:\\Windows\\notepad.exe"});
}
}
When I run this, it starts notepad, but the process doesn't actually end until I close notepad. The only way to verify this is that the process explorer still shows the java process running.
Is there any way to detach processes so that the current program can exit? I am testing this on Windows Vista Business and Java 6 update 2. Thanks for any help,
Kevin

