-3

I have been receiving a StackOverflowError when I try to compile my Java project in IntelliJ IDEA 15.0.3.

I have read through the internet and it told me that it could be of recursive methods and loops. It also said that it, most of the times, is my code. Now I have commented out every recursive method/loop and it still didn't work.

Possible sources: http://pastebin.com/yBn2WCCY

To anyone who would be so kind to test it in their IDE: http://www.megafileupload.com/o77K/SkyWarsLobby_-_MODULE.rar Don't forget to add the dependencies. Thanks :)

Guus Huizen
  • 165
  • 1
  • 2
  • 9
  • Can you post the class which you try to compile? StackOverflowError is thrown at runtime so I guess that when you run your class you do have some king of recursive behaviour. – Slimu Aug 12 '16 at 07:43
  • How should someone help if you don't provide the actual code? – Andreas Brunnet Aug 12 '16 at 07:43
  • I will post my code. I am not trying to compile a single class, I am trying to compile a whole project. Please give me a second. Thanks for your quick responses :) – Guus Huizen Aug 12 '16 at 07:45
  • Added the possible sources. Thanks for checking out. – Guus Huizen Aug 12 '16 at 07:52
  • In which class/method do you get the Error? – Slimu Aug 12 '16 at 09:07
  • @Slimu I get the error during compilation in IntelliJ IDEA 15.0.3 – Guus Huizen Aug 12 '16 at 09:07
  • Are you running the 32 bit version of IDEA on a 64 bit machine? – Slimu Aug 12 '16 at 09:12
  • Can you check how much MB you have in Settings -> Build, Execution, Deployment -> Compiler -> Build process heap size? Maybe it's too small and you need to increase it – Slimu Aug 12 '16 at 09:14
  • @Slimu how would I check, I know compiling worked in the past for sure, and I also tried installing it using the same file on a 64-bit system and it didn't work either. – Guus Huizen Aug 12 '16 at 09:15
  • @Slimu I have already changed that, it is currently running on 1024 as I upgraded it from the default value (I don't remember what it was exactly). My laptop has 2GB of ram (I am away from home at the moment) That couldnt be the problem as I also tried it on a 8GB laptop (the 64-bit laptop). – Guus Huizen Aug 12 '16 at 09:18
  • Can you make a zip with the project? I will test it on my IDEA 2016.2 – Slimu Aug 12 '16 at 09:22
  • The internet is rather slow here, I will try and upload it to GDrive and put it in the original post. I will also try upgrading the allocated ram on my other laptop. Please give me a couple of minutes. – Guus Huizen Aug 12 '16 at 09:29
  • Nvm It doesnt work – Guus Huizen Aug 12 '16 at 09:55
  • I downloaded the files and created a new project based on them and compilation went fine. Can you post the error message? – Slimu Aug 12 '16 at 10:18
  • @Slimu http://prntscr.com/c4sa66 it shows me these errors, what Java version did you use and how much ram did you allocate to the JVM? – Guus Huizen Aug 12 '16 at 10:47
  • I used java 1.8.0_60 for compilation, IDEA 2016.2.1 and 700 MB for the build process heap size – Slimu Aug 12 '16 at 11:16
  • Try to comment all the code from your classes and gradually uncomment to see where your compilation fails – Slimu Aug 12 '16 at 11:34

1 Answers1

2

First, try to apply tail call optimization, when the recursive call is the last statement in your method. Then, as suggested in comments, check your IntelliJ settings.

Useful links:

Read more about TCO.

Read more about StackOverflowError.

Community
  • 1
  • 1
adsalpha
  • 102
  • 2
  • 10