0

I installed sbt using Homebrew and it installed correctly. I am able to build projects and do all sbt tasks. However when I try to enter sbt interactive mode it shows the below and exits. For everything else sbt works fine.

[info] Set current project to sbt_test (in build file:/Users/binshi/sbt_test/)
[warn] The `-` command is deprecated in favor of `onFailure` and will be removed in 0.14.0
[warn] The `-` command is deprecated in favor of `onFailure` and will be removed in 0.14.0
[warn] The `-` command is deprecated in favor of `onFailure` and will be removed in 0.14.0
[warn] The `-` command is deprecated in favor of `onFailure` and will be removed in 0.14.0
[warn] The `-` command is deprecated in favor of `onFailure` and will be removed in 0.14.0
Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
binshi
  • 1,248
  • 2
  • 17
  • 33
  • What exactly do you type in the command prompt to enter interactive mode? All you have to do is type `sbt` – Sergey May 28 '16 at 08:21
  • Yes, all I type is sbt. Then the above message and instead of stopping at > prompt it exits. – binshi May 28 '16 at 09:42
  • Could you perhaps share the contents of your `build.sbt`, especially the `scalacOptions` part? – Sergey May 28 '16 at 10:02
  • This question looks related to your problem: [Play, re-run with -feature for details](http://stackoverflow.com/questions/23926515/play-re-run-with-feature-for-details) – Sergey May 28 '16 at 10:03
  • I saw the comments in the link before. Shouldn't the sbt command run right off the sbt package before a project is created? Hence it does not contain build.sbt or scalacOptions. – binshi May 28 '16 at 10:06
  • You should run it from the root directory of your project. – Sergey May 28 '16 at 10:15
  • I ran it from the root directory of the project. I still get the same error – binshi May 28 '16 at 23:54

1 Answers1

0

After some digging around I found the source of my error to the file /usr/local/etc/sbtopts. It had the following line added at the end by some program I had installed.

-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled XX:MaxPermSize=256M

Whenever sbt launches the above line is passed as arguments which was causing the above error. As these are java options to solve it either we can add -J before the above line or delete the line completely. Then sbt should start working normally.

binshi
  • 1,248
  • 2
  • 17
  • 33