Reputation: 1
First time asking a question on here, I've been lurking for a while attempting to search for the answer to this issue but I can't seem to find a proper solution.
Information:Using javac 1.8.0_31 to compile java sources
Information:java: The system is out of resources.
Information:java: Consult the following stack trace for details.
Information:java: at com.sun.tools.javac.parser.JavaTokenizer.readToken(JavaTokenizer.java:560)
Information:java: at com.sun.tools.javac.parser.Scanner.nextToken(Scanner.java:115)
Information:java: at com.sun.tools.javac.parser.JavacParser.nextToken(JavacParser.java:301)
Information:java: at com.sun.tools.javac.parser.JavacParser.literal(JavacParser.java:759)
Information:java: at com.sun.tools.javac.parser.JavacParser.literal(JavacParser.java:659)
Information:java: at com.sun.tools.javac.parser.JavacParser.term3(JavacParser.java:1157)
Information:java: at com.sun.tools.javac.parser.JavacParser.term2(JavacParser.java:909)
Information:java: at com.sun.tools.javac.parser.JavacParser.term1(JavacParser.java:880)
Information:java: at com.sun.tools.javac.parser.JavacParser.term(JavacParser.java:836)
Information:java: at com.sun.tools.javac.parser.JavacParser.term(JavacParser.java:816)
Information:java: at com.sun.tools.javac.parser.JavacParser.parseExpression(JavacParser.java:779)
Information:java: at com.sun.tools.javac.parser.JavacParser.arguments(JavacParser.java:1779)
Information:java: at com.sun.tools.javac.parser.JavacParser.classCreatorRest(JavacParser.java:2219)
Information:java: at com.sun.tools.javac.parser.JavacParser.creator(JavacParser.java:2103)
Information:java: at com.sun.tools.javac.parser.JavacParser.term3(JavacParser.java:1166)
Information:java: at com.sun.tools.javac.parser.JavacParser.arguments(JavacParser.java:1794)
Information:java: at com.sun.tools.javac.parser.JavacParser.term3(JavacParser.java:1255)
Information:java: at com.sun.tools.javac.parser.JavacParser.blockStatement(JavacParser.java:2392)
Information:java: at com.sun.tools.javac.parser.JavacParser.blockStatements(JavacParser.java:2298)
Information:java: at com.sun.tools.javac.parser.JavacParser.block(JavacParser.java:2269)
Information:java: at com.sun.tools.javac.parser.JavacParser.block(JavacParser.java:2283)
Information:java: at com.sun.tools.javac.parser.JavacParser.parseStatement(JavacParser.java:2441)
Information:java: at com.sun.tools.javac.parser.JavacParser.blockStatement(JavacParser.java:2352)
Information:java: at com.sun.tools.javac.parser.JavacParser.parseStatementAsBlock(JavacParser.java:2317)
Information:java: at com.sun.tools.javac.parser.JavacParser.parseStatement(JavacParser.java:2445)
Information:java: at com.sun.tools.javac.parser.JavacParser.parseStatement(JavacParser.java:2449)
Information:java: Errors occurred while compiling module 'Server'
Information:5/1/2015 5:45 AM - Compilation completed with 1 error and 0 warnings in 952ms
Error:java: java.lang.StackOverflowError
I've never had issues running my program before and I'm not sure what could be the cause of this.
My system has 6 gb of ram available with 1gb allocated to the JVM. When running a previous version, I have no issues.
If anyone could help me troubleshoot what the cause of this might be, I would appreciate it.
Sorry about the question, I literally copy/pasted the entire source to a different module with the same exact settings and it's working good as new. If anyone has any explanation as to why this is the case, please, let me know.
Upvotes: 0
Views: 2425
Reputation: 36339
Firstly, you don't run your program, you compile it. It is the java compiler that dies of stack overflow.
Clearly, your source code is too complicated for the java compiler to deal with. To run the java compiler with more stack space
javac -J-Xss4m ....
If you don't run javac
directly, but through some "build tool", this is the time to find out how good it is. A good build tool, while providing reasonable defaults, should let you customize your final compilation command line at will.
Upvotes: 4