Why does sbt compile fail with StackOverflowError?

后端 未结 8 1259
孤独总比滥情好
孤独总比滥情好 2021-01-31 15:30

I am working on a Scala project that has been in existence for a few years but is new to me. My task is to upgrade it from Scala 2.9.3 to 2.11.7, along with its dependencies. I

8条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-31 15:57

    I figured it out. Once I knew that the -d flag would tell me what settings SBT was actually using, I saw that the values in my SBT_OPTS environment variable were being clobbered by other, lower settings. Where were those coming from? From my JAVA_OPTS env variable! I should have noticed them sooner, but now I know I can keep those Java options as they are and override them by adding the SBT-specific settings to my /usr/local/etc/sbtopts file, using the somewhat awkward format of

    -J-Xmx2G
    -J-Xss2M 
    

    Using the values shown I was able to run sbt compile successfully on my project.

    I hope someone finds this useful.

提交回复
热议问题