2
當我使用maven時,遇到了一個被解僱的問題。我使用「maven exec:java」執行下面的代碼。 顯然,它應該拋出一個RuntimeException,但是我在控制檯中沒有看到任何東西。但是如果我在eclipse中執行它,我可以看到錯誤信息。那麼異常去了哪裏?由於異常信息在哪裏?
public class HelloWorld {
public static class MyThread extends Thread {
@Override
public void run() {
String str = null;
str = str.trim();
}
}
public static void main(String[] args) throws InterruptedException, IOException {
MyThread thread = new MyThread();
thread.start();
System.in.read();
}
}
也許它會進入日誌文件? – casablanca 2010-10-21 01:29:58