Java tutorial
import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class Main { public static void main(String[] args) { Runnable badTask = () -> { throw new RuntimeException("Throwing exception from task execution..."); }; ExecutorService exec = Executors.newSingleThreadExecutor(); exec.execute(badTask); exec.shutdown(); } }