public static void main(String[] args) { Thread thread = new Thread(new Download(args)); thread.setDaemon(true); thread.start(); try { thread.join(); } catch (Exception e) { e.printStackTrace(); } }