build.xmlファイルがあるディレクトリに移動
デフォルトでは
$ ant compile
BUILD FAILED
/path/appengine-java-sdk-1.2.0/demos/guestbook/build.xml:39: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-6-openjdk/jre"
Total time: 0 seconds
BUILD FAILED
/path/appengine-java-sdk-1.2.0/demos/guestbook/build.xml:39: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-6-openjdk/jre"
Total time: 0 seconds
とエラーが出る。
<target name="compile" depends="copyjars"※太字の部分を追加fork属性を追加することでコンパイルが可能になった。開発サーバは毎回停止しなければいけないらしい。
description="Compiles Java source and copies other source files to the WAR.">
<mkdir dir="war/WEB-INF/classes" />
<copy todir="war/WEB-INF/classes">
<fileset dir="src">
<exclude name="**/*.java" />
</fileset>
</copy>
<javac
srcdir="src"
destdir="war/WEB-INF/classes"
classpathref="project.classpath"
debug="on"
fork="true" />
</target>
0 件のコメント:
コメントを投稿