在我的蚂蚁中build.xml
:
<path id="gwt.path">
<pathelement location="gen/bin/main"/>
<fileset dir="lib/main">
<filename name="gin-2.1.2.jar"/>
<filename name="guice-3.0.0.jar"/>
<filename name="guice-assistedinject-3.0.0.jar"/>
<filename name="gwt-bootstrap-2.2.2.jar"/>
<filename name="gwt-bootstrap-sources-2.2.2.jar"/>
<filename name="gwt-dev.jar"/>
<filename name="gwt-user.jar"/>
<filename name="javax-inject-1.0.0.jar"/>
<filename name="requestfactory-apt.jar"/>
<filename name="requestfactory-client+src.jar"/>
<filename name="validation-api-1.0.0.GA.jar"/>
<filename name="validation-api-1.0.0.GA-sources.jar"/>
</fileset>
</path>
<target name="gwtc" depends="main-compile">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="src/main/java"/>
<path refid="gwt.path"/>
</classpath>
<jvmarg value="-Xmx256M"/>
<arg line="-war"/>
<arg value="gen/war" />
<arg line="-logLevel"/>
<arg value="ALL"/>
<arg line="-optimize"/>
<arg value="9"/>
<arg line="-extra"/>
<arg value="gen/staging"/>
<arg line="-compileReport"/>
<arg value="net.myapp.MyModule"/>
</java>
</target>
当我运行gwtc
目标时,我得到:
...
[java] Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gwt/dev/Compiler
[java] Caused by: java.lang.ClassNotFoundException: com.google.gwt.dev.Compiler
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
[java] Could not find the main class: com.google.gwt.dev.Compiler. Program will exit.
BUILD FAILED
/home/myUser/MyProject/build.xml:181: Java returned: 1
Total time: 2 seconds
这里发生了什么?我正在添加gwt-dev.jar
到 my gwt.path
,这意味着它应该在<java>
任务运行并尝试找到com.google.gwt.dev.Compiler
. 那么我哪里错了?提前致谢!