But copyrighting APIs goes too far.
Au contraire, I think it clearly solves the economic problem of free-riding in this particular case. Consider:
1) Sun (and now by proxy, Oracle) made a huge investment in engineering to make Java, and a big part of its success was a API for the standard lib that maintained a coherence across disparate domains ranging from file systems to networking to databases to cryptography to UIs.
2) Sun made an even more massive investment in marketing to make Java as prevalent as it is today. Without marketing a language goes nowhere, and yet Java is ubiquitous. Along with 1), this represents a massive economic investment.
3) Google had no inclination of investing its own time, money and resources to build its own ecosystem and build developer mindshare for it, not when it was trying to compete with the iPhone and wanted warm bodies to build apps for their platform. To make it worse, Google's engineers and executives knew that a) they had no better alternatives and would require a license (google "Lindholm email"), and b) that they were not going to be complying with Sun's terms (Ctrl-F "Rubin" on this page). Yet they went ahead and re-used Java for their purposes without permission or recompense to Sun.
I don't see how that's not "economic free-riding" in the most literal sense.