Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.tools.ant.util.FileUtils.<clinit>(FileUtils.java:63)
at org.apache.tools.ant.Project.<clinit>(Project.java:131)
at Pv.plugin_execute(Pv.java:140)
at Pv.main(Pv.java:194)
Caused by: java.lang.NullPointerException
at org.apache.tools.ant.taskdefs.condition.Os.<clinit>(Os.java:31)
... 4 more
这是我从 java 文件中运行 ant 目标的代码。我已经为它设置了所有参数。代码在 Linux 环境下运行。
File buildFile = new File(bDir + "/" + pBDir + "/"+ atBFile);
Project p = new Project();
p.setUserProperty("ant.file", buildFile.getAbsolutePath());
p.init();
ProjectHelper helper = ProjectHelper.getProjectHelper();
p.addReference("ant.projectHelper", helper);
helper.parse(p, buildFile);
p.executeTarget(target);
谁能帮我这个?昨天它运行良好,今天它给了我这个例外......