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
This is my code to run an ant target from my java file.
I have set all the parameters for it.
Code runs on Linux environment.
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);
Can anyone help me with this? Yesterday it was running fine, today it gave me this exception…
Given the source code it looks like you don’t have the system property of “os.name” set for some reason. You should look into why that’s not set, but you could always specify it manually from the command line if necessary.