代码之家  ›  专栏  ›  技术社区  ›  zjffdu

异常信息在哪里?

  •  2
  • zjffdu  · 技术社区  · 15 年前

    我使用maven时遇到了一个奇怪的问题。我使用“maven exec:java”执行以下代码。

    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();
        }
    }
    
    2 回复  |  直到 15 年前
        1
  •  3
  •   Pascal Thivent    15 年前

    可能是Maven Exec插件的一个bug(参见 MEXEC-89 MEXEC-80 ). 尝试使用插件的1.2版:

    mvn org.codehaus.mojo:exec-maven-plugin:1.2:java -Dexec.mainClass="com.acme.Foo"
    
        2
  •  0
  •   Jörn Horstmann    15 年前

    -e 命令行选项到您的mvn调用,我想解决了一个类似的问题,我有。

    推荐文章