Sbt always does full rebuild because of modified binary dependency: rt.jar:
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set(C:\Program Files\Java\jdk1.6.0_37\jre\lib\rt.jar)
[debug] Initial directly invalidated sources: Set()
Obviously, rt.jar wasn’t changed, its created/accesses/modified dates are the same and quite old.
It’s in c:\Program Files\Java\jdk1.6.0_37\jre\lib\
JAVA_HOME is set as C:\Progra~1\Java\jdk1.6.0_37
JAVA_HOME/bin is in PATH.
Any ideas why sbt thinks rt.jar was changed?
I had JAVA_HOME set to C:\Progra~1\Java\jdk1.6.0_37 and sbt resolved the dependency as C:\Program Files\Java\jdk1.6.0_37\jre\lib\rt.jar. Sbt uses java.io.File.equals() which is not correct in this case:
In sbt/compile/inc/Incremental.scala:
gives the following output:
Thus, sbt always thinks rt.jar was changed.
Workaround would be setting JAVA_HOME to “c:\Program Files\Java\jdk1.6.0_37”
Solution would be to do: