How to use sbt from behind proxy?

sbt respects the usual environment variables for http proxy settings: export JAVA_OPTS=”$JAVA_OPTS -Dhttp.proxyHost=yourserver -Dhttp.proxyPort=8080 -Dhttp.proxyUser=username -Dhttp.proxyPassword=password” (That’s of course, assuming Unix (Linux/OSX etc). On windows you could just set the same environment variable (%JAVA_OPTS%) as usual in the Windows way.) Then run sbt as usual: sbt Switching between proxy/no-proxy should be a matter of setting … Read more

Class broken error with Joda Time using Scala

Add this dependency: “org.joda” % “joda-convert” % “1.8.1” It’s an optional dependency of joda-time. I had to add it in my own project for the scala compiler to accept working with the joda-time jar. Your issue seems to be the same. Version is as at time of editing, latest versions can be found here

Intellij compile failures: “is already defined as”

For me, the reason is that both myproject/src and myproject/src/main/scala are marked as Source. So IntelliJ failed to build myproject/src/main/scala due to above errors. Unmark Source from myproject/src (in IntelliJ, File->Project structure, select myproject Module, select src folder in Sources Tab, remove it from Source in the “Add Content Root” pane) solved the problem.

How to build an Uber JAR (Fat JAR) using SBT within IntelliJ IDEA?

Finally I totally skip using IntelliJ IDEA to avoid generating noise in my global understanding 🙂 I started reading the official SBT tutorial. I created my project with the following file structure : my-project/project/assembly.sbt my-project/src/main/scala/myPackage/MyMainObject.scala my-project/build.sbt Added the sbt-assembly plugin in my assembly.sbt file. Allowing me to build a fat JAR : addSbtPlugin(“com.eed3si9n” % “sbt-assembly” … Read more

How to set heap size for sbt?

You need SBT_OPTS, here’s what I use in my .bash_profile: export SBT_OPTS=”-Xmx1536M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=2G -Xss2M -Duser.timezone=GMT” UPDATE: To get your 2G heap space you can use this: export SBT_OPTS=”-Xmx2G -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=2G -Xss2M -Duser.timezone=GMT” NOTE: SBT MUST BE LATEST VERSION Older versions of sbt contain bugs that override these settings, use brew upgrade sbt … Read more

Can someone explain the right way to use SBT?

Most importantly is probably, how do you find the right repositories and versions to include in your project? Do I just pull out a machette and start hacking my way forward? I quite often find projects that include everything and the kitchen sink For Scala-based dependencies, I would go with what the authors recommend. For … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)