我一直在尝试在Intellij中使用Ant编译一个项目,当javac任务运行时,没有输出,但没有错误。如果我使用相同的构建文件手动运行 ant,所有内容都会正确编译,并且我会从 javac 获得输出。
这是 build.xml 中的任务:
<javac classpathref="libClassPath" srcdir="${sourceFolderPath}" destdir="${classFilePath}" verbose="true" debug="true"/>
这是intellij ant的输出:
build.xml
property
taskdef
fileset
path
property
taskdef
taskdef
compileClasses
echo
===== Compiling src files C:\Users\user\project\Build/../src
echo
Class file Path: C:\Users\user\project\Build/dist/classes
mkdir
Created dir: C:\Users\user\project\Build\dist\classes
javac
显示所有输出已打开。不知道我错过了什么。我也重新安装过intellij,还是没用。
最佳答案
所以这是 ant/lib 目录中的一个 jar 的问题。其中一张压缩包的 zipper 不正确,或者已损坏。一旦我更换了这个 jar ,一切就开始工作了。
我能够找到此问题的唯一方法是使用 IDEA 中的 javac2 任务。由于某种原因,这个错误在使用正常的 javac 任务时被 intellij 隐藏了。
谢谢@Ishnark 的帮助。
关于java - Intellij Ant - javac 不编译文件,没有错误或消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44317557/