I have a Java project that contains many very large source files and it compiles fine in Eclipse, however it will not compile with javac from the command line or within Ant.
When I try to compile it from the command with javac (or using Ant) I get a StackOverflow Exception:
[javac] java.lang.StackOverflowError
[javac] at com.sun.tools.javac.jvm.Gen.genCond(Gen.java:786)
[javac] at com.sun.tools.javac.jvm.Gen.genCond(Gen.java:739)
[javac] at com.sun.tools.javac.jvm.Gen.visitBinary(Gen.java:1841)
[javac] at com.sun.tools.javac.tree.Tree$Binary.accept(Tree.java:926)
[javac] at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:806)
[javac] at com.sun.tools.javac.jvm.Gen.genCond(Gen.java:786)
...
...
...
I have tried passing a number of arguments to the JVM such as -Xss, -Xmx, -Xoss etc both on the command line and in the Ant javac task but I always get the same error.
From what I have read, it seems that the Eclipse IDE has a compiler that is different to the Sun JDK. Is there a way to get the JDK to compile in a similar way to Eclipse?
Thanks, Stef
This is odd, but I have found that I can compile the code with JDK 1.6.
This isn't solving my problem because the code is used as a lib by another project and it complains and compiled version numbers as JDK 1.5 is the project standard at the moment (and will be for another few months).
Does anyone know what has changed in 1.6 and is it possible to apply those changes to 1.5 by flags?