I'm starting a java program in background with java what.ever.Class &
. It throws an exception in the first line and prints out the stack.
I'd expect the java process to exit at that point, but for some reason it stays there waiting (no code running, not threads spawned, etc.). It's not a zombie, because it exits properly on the first SIGTERM. What might be the reason it doesn't exit immediately?
Added:
Actually that doesn't happen every time. If I run the command from the command line - it exits just fine. If the same command is run from a script (the script is just #!/bin/sh
/ java what.ever.Class &
) then it stays in the background.
nohup and redirections don't work.
Using Debian, OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-2) / OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode). The sh is actually dash.