一个ant简单问题
为什么报这个错误呢,
element type "project "must be followed by either attribute specfiication
, "> "or "/> "
可是我明明有结尾呀...
我是按照书上操作的,build.xml文档也没有错误呀
<?xml version= "1.0 " encoding= "UTF-8 "?>
<project name= "base "default= "run "basedir= ". ">
<property name= "src "value= "src "/>
<property name= "dist "value= "classes "/>
<property name= "hello_jar "value= "hello.jar "/>
<target name= "init ">
<mkdir dir= "${dist} "/>
</target>
<target name= "compile " depents= "init ">
<javac srcdir= "${src} "destdir= "${dist} "/>
</target>
<target name= "build " depends= "compile ">
<jar jarfile= "${hello_jar} " basedir= "${dist} "/>
</target>
<target name= "run "depends= "build ">
<java classname= "antdemo.HelloWorld_ant "classpath= "${hello_jar} "/>
</target>
</project>
------解决方案--------------------这不叫ANT的问题.是你的问题.要注意XML中Element的多个属性要用空格隔开.