The US Supreme Court has come down on the side of Google in its long-running battle against Oracle, ruling on Monday that the copying of code from the Java API was a fair use of that material.