[java] Could not find Hello. Make sure you have it in your classpath
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:140)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:832)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:226)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:498)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:352)
[java] at org.apache.tools.ant.Target.execute(Target.java:437)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:458)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1406)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1377)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:36)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1261)
[java] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:460)
[java] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:142)
[java] Java Result: -1
解决方式:<!--运行java文件-->
<target name="run" depends="compile">
<java classname="com.serviceHello"> //这个写类的全路径
<classpath>
<pathelement path="classes"/>
</classpath>
</java>
</target>