JavaFX 8 ant构建错误代码太大

时间:2015-10-11 18:43:20

标签: java eclipse ant javafx build.xml

我正在开发日食;我的代码目前正在编译并直接从eclipse运行查找(通过执行Run As Java Application) - 我没有遇到任何错误。

然后我尝试生成Ant build.xml并尝试编译它,终止为BUILD FAILED;下面是构建的输出:

Buildfile: C:\App-Path\build\build.xml
setup-staging-area:
   [delete] Deleting directory C:\App-Path\build\externalLibs
   [delete] Deleting directory C:\App-Path\build\project
   [delete] Deleting directory C:\App-Path\build\projectRefs
    [mkdir] Created dir: C:\App-Path\build\externalLibs
     [copy] Copying 1 file to C:\App-Path\build\externalLibs
     [copy] Copying 1 file to C:\App-Path\build\externalLibs
     [copy] Copying 1 file to C:\App-Path\build\externalLibs
     [copy] Copying 1 file to C:\App-Path\build\externalLibs
     [copy] Copying 1 file to C:\App-Path\build\externalLibs
     [copy] Copying 1 file to C:\App-Path\build\externalLibs
     [copy] Copying 1 file to C:\App-Path\build\externalLibs
     [copy] Copying 1 file to C:\App-Path\build\externalLibs
     [copy] Copying 1 file to C:\App-Path\build\externalLibs
    [mkdir] Created dir: C:\App-Path\build\project
     [copy] Copying 59 files to C:\App-Path\build\project
     [copy] Copied 22 empty directories to 2 empty directories under C:\App-Path\build\project
    [mkdir] Created dir: C:\App-Path\build\projectRefs
do-compile:
   [delete] Deleting directory C:\App-Path\build\build
    [mkdir] Created dir: C:\App-Path\build\build\src
    [mkdir] Created dir: C:\App-Path\build\build\libs
    [mkdir] Created dir: C:\App-Path\build\build\classes
     [copy] Copying 9 files to C:\App-Path\build\build\libs
     [copy] Copying 59 files to C:\App-Path\build\build\src
     [copy] Copied 21 empty directories to 2 empty directories under C:\App-Path\build\build\src
    [javac] Compiling 29 source files to C:\App-Path\build\build\classes
    [javac] C:\App-Path\build\build\src\com\stt3\types\IcomoonUltimatePack.java:60: error: code too large
    [javac]         HOME('\ue900'),
    [javac]         ^
    [javac] Note: C:\App-Path\build\build\src\com\stt3\test\YQLParser.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 1 error

BUILD FAILED
C:\App-Path\build\build.xml:107: Compile failed; see the compiler error output for details.

Total time: 3 seconds

似乎正在生成错误的类只是对IcoMoon字形集的JavaFX FontAwesome Glyph类(定义{{​​3}})的现有代码的修改(大约2000个字形/字符关联)。

以下是违规类代码的链接:here

由于代码在eclipse中直接编译并运行良好,我想知道我是否遗漏了ant编译器中的任何参数。我无法弄清楚如何解决这个问题。

非常感谢任何帮助。

谢谢

1 个答案:

答案 0 :(得分:2)

Java中的方法仅限于 64k 字节代码。一旦超过限制,java编译器就会抛出错误

error: code too large

所有静态初始化都是在一个方法中完成的,因此有可能发生这种情况。

它在eclipse中运行正常,因为eclipse有自己的编译器。

如果您想了解更多信息,this是一个不错的主题。