I have a Java project containing many very large source files and it compiles fine in Eclipse, however it will not compile with javac from the command line or inside Ant.
When I try to compile it from a command using 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 tried passing a few JVM arguments, such as -Xss, -Xmx, -Xoss, etc. both on the command line and in the Ant javac task, but always get the same error.
From what I read, it seems that the Eclipse IDE has a compiler different from the Sun JDK. Is there a way to get the JDK to compile similarly to Eclipse?
Thanks Stef
This is strange, but I found that I could compile code with JDK 1.6.
, lib , , JDK 1.5 ( ).
- , 1.6, 1.5 ?