9
すべて見つけることができない -のtaskdef Antタスクは
私は、このページ上で最も最も簡単な指示に従っています:
http://ant.apache.org/manual/develop.html
しかし、私はターゲットを実行しようとすると、「メイン」私はNetBeansでこのエラーを取得:
taskdef class dec102012.MyAntTask cannot be found using the classloader AntClassLoader[]
しかし、この
package dec102012;
import org.apache.tools.ant.BuildException;
public class MyAntTask extends org.apache.tools.ant.Task{
private String msg;
// The method executing the task
public void execute() throws BuildException {
System.out.println(msg);
}
// The setter for the "message" attribute
public void setMessage(String msg) {
this.msg = msg;
}
}
ように私のbuild.xml内の関連する部分が見えます:問題はAntのクラスローダである
<taskdef name="mytask" classname="dec102012.MyAntTask" classpath="dec102012"/>
<target name="main">
<mytask message="Hello World! MyVeryOwnTask works!"/>
</target>
'classpath =" dec102012 "' –
私はそれをやると同じエラーになります。 – user1068636