Invalidate cache if the Java target version or Scala compiler version changes.

Bugs closed: 76

Reviewed at https://rbcommons.com/s/twitter/r/277/