1

Recently I try to migrate my java web application from java 1.7 to 1.8 using eclipse.

The Eclipse compile my project with java 1.7 is fine. But when I changed the library to java 1.8 to try to compile, the compile job is not stop and then after few hours it prompt error:

java.lang.outofmemoryerror: java heap space

I try to add the vm argument with command -Xms2048m -Xmx8192m, but it still fail. It seems not related to the memory problem but the java version problem. Does any one can help?

Below please find the details of the environment information:

Current project compiled successfull Java Verison: jdk1.7.0_97
Compfiled fail Java Version: jre1.8.0_151 
Eclipse version: Luna Release (4.4.0)
Ming
  • 33
  • 6
  • Possible duplicate of [Increasing heap space in Eclipse: (java.lang.OutOfMemoryError)](https://stackoverflow.com/questions/8600972/increasing-heap-space-in-eclipse-java-lang-outofmemoryerror) – akshaya pandey Jan 22 '18 at 09:19
  • "after a few hours" sounds like a bug. Nothing normally compiles that long. Does it compile with the JDK compiler (not the Eclipse one)? – Thilo Jan 22 '18 at 09:19
  • Re- akshaya pandey: Thanks. I had try to modify the command even in eclipse.ini or in the java run configure or in the JRE definition. But both of solution is not work. – Ming Jan 22 '18 at 09:49
  • Can you reproduce this issue with Eclipse Oxygen.2 (4.7.2)? – howlger Jan 22 '18 at 09:50
  • Re- Thilo: Is it difference for compiling with JDK or JRE? I will try it later. Thanks! – Ming Jan 22 '18 at 09:54

1 Answers1

1

I fixed the problem that I try to removed the related source that causing this problem and got another error message: java.lang.StackOverflowError at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.mentionsAny(ParameterizedTypeBinding.java:915)

Than I got the answer from below question: Eclipse Luna StackOverflow exception at Build Time

The problem is the eclipse Luna version 4.4.0 or below compiled with Java 1.8 may cause this problem. But the problem should be fixed in Luna 4.4.1.

I change to use oxygen 3 RC3(v4.7) and it is fine.

Ming
  • 33
  • 6