The trial is trying to decide on what damages, if any, Google should pay Oracle — which became the owner of Java when it acquired Sun in 2010 — for the use of 37 APIs in its Android mobile operating systems.
Schwartz testified that Java and its APIs were free and open to use when the language was under Sun's umbrella. But subsequently, APIs have been declared copyrightable following the reversal of a judgement that was made in the first trial in 2012.
The same judge who is presiding over the current trial, Justice William Alsup, made the initial determination in 2012 when the case that Oracle launched against Google in 2010 came to an end. But that verdict was overturned.
Schwartz said Sun wanted the deal so it could push Java through Android. Google pulled out of talks because it did not want to rely on anyone.
Earlier, Eric Schmidt, the chairman of Google's parent company Alphabet, said he had been willing to pay between US$30 million and US$40 million to Sun for a licence that lasted five years beginning in 2006. It would have meant that Google would use Sun's logo in some parts of Android and include more Java software than it ultimately ended up including.
Schmidt said he believed due to his experience with Java, that Google did not need a licence to use the APIs which it ended up using as long it used its own code.
Oracle's lawyers pointed Schmidt to a programming book produced by Sun in 1995 wherein a sample Java licence was contained but Schmidt said he had not seen the book for more than a decade and could not recall whether it had a sample licence or not.
In an email that was produced in the 2012 trial, and again on Wednesday, a software engineer from Google, who had been asked by founders Larry Page and Sergey Brin to evaluate technical alternatives to Java, wrote that everything else sucked and Google needed to negotiate a licence to use Java.