how to check if main thread is running from child java code example Example: java check if thread is running Thread.isAlive()