Netbeans中默认的ant设置属性
build.compiler.emacs
被设置为true
。这是什么意思?ant文档只是说:
启用emacs兼容的错误信息。
我知道emacs是一个编辑器,但我没有使用过它。将此属性设置为true或false有什么效果?
build.xml
文件。<project name="mini" basedir="." default="compile">
<property name="build.compiler.emacs" value="off"/>
<property name="build.compiler" value="jikes"/><!-- invoke jikes instead of javac-->
<target name="compile">
<javac srcdir="." destdir="" classpath="." includeantruntime="false">
</javac>
</target>
</project>
Buildfile: /Users/seb/projets/java/ant/build.xml
compile:
[javac] Compiling 1 source file to /Users/seb/projets/java/ant
[javac]
[javac] Found 1 semantic error compiling "Hello.java":
[javac]
[javac] 5. System.out.println("Hello, World!"+foo);
[javac] ^-^
[javac] *** Semantic Error: No accessible field named "foo" was found in type "Hello".
BUILD FAILED
/Users/seb/projets/java/ant/build.xml:5: Compile failed; see the compiler error output for details.
Total time: 1 second
如果你将build.compiler.emacs
属性更改为on
,你可以获得以下输出:
Buildfile: /Users/seb/projets/java/ant/build.xml
compile:
[javac] Compiling 1 source file to /Users/seb/projets/java/ant
[javac] Hello.java:5:52:5:54: Semantic Error: No accessible field named "foo" was found in type "Hello".
BUILD FAILED
/Users/seb/projets/java/ant/build.xml:5: Compile failed; see the compiler error output for details.
Total time: 1 second