SAN FRANCISCO—Alphabet Chairman and former Google CEO Eric Schmidt testified in a federal court here today, hoping to overcome a lawsuit from Oracle accusing his company of violating copyright law.

During an hour of questioning by Google lawyer Robert Van Nest, Schmidt discussed his early days at Google and the beginnings of Android. Everything was done by the book, Schmidt told jurors, emphasizing his positive relationship with Sun Microsystems and its then-CEO Jonathan Schwartz.

Schmidt himself used to work at Sun Microsystems after getting his PhD in computer science from UC Berkeley in 1982. Schmidt was at Sun while the Java language was developed.

"Was the Java language released for anyone to use?" asked Van Nest.

"There was no charge to use the language," Schmidt explained. "Sun had a license for the implementation, which you would need to sign up for. And there was a trademark license, which would include the Java logo, which you could pay a fee for."

Schmidt moved from Sun to Novell in 1997, and he joined Google in 2001.

"I wanted to work with the two young founders, and the board convinced me to take the job," he said.

Sun-ny days, no permission needed

Schmidt walked through Google's process of building Android, emphasizing that Google built Android on its own. The company used only what it thought was freely available, Schmidt said—including the Java language and its APIs.

"We had software programmers who did a different implementation, without using the technology Sun had developed," he said.

They didn't use any of Sun's "implementing code," nor did they get the right to use the Java logo. That would have been helpful, but for that, they would have had to pay.

Schmidt testified that he had used APIs without permission in other situations, including a product he worked on at Sun that used Microsoft APIs.

Schmidt: We believed it was possible to implement the language, without a license from Sun. Van Nest: And you believed you could use the APIs? Schmidt: Yes, we believed it was permissible to do so. Van Nest: And what was your basis for that? Schmidt: Forty years of experience.

Even though they didn't reach a deal, Sun Microsystems CEO Jonathan Schwartz celebrated Android with a blog post "offering [his] heartfelt congratulations."

Van Nest: Was it a secret that Google was building Android with Java? Schmidt: Certainly not. Van Nest: Was he [Schwartz] made aware that these phones were shipping? Schmidt: Yes. Van Nest: Did he ever express disapproval about what you were doing? Schmidt: He did not. Van Nest: Did Schwartz ever suggest it was wrong or infringing for Android to use the APIs? Schmidt: He did not. Van Nest: Did he ever tell you, in meetings, discussions, or e-mails, that Google needed a license from Sun to use the APIs? Schmidt: He did not.

At just before noon, Van Nest ended his examination, and Oracle lawyer Peter Bicks began an aggressive cross-examination.

Licenses, licenses everywhere

Early on in his cross, Bicks called into question Schmidt's warm and fuzzy description of his relationship with Sun and Schwartz.

"Point out in this memo [about the meeting] where you told him you were going to take the design of those API packages," Bicks said. Schmidt couldn't.

Bicks pulled up an e-mail between Schwartz and Schmidt.

"Tell me in here where there’s reference to these API packages," Bicks said.

"The license here is Apache 2.0," said Schmidt. "That covers all the work we did, including implementation of the APIs."

"One thing we can agree on is, you never got a written license for those API packages, is that correct?" Bicks asked.

"That is correct," said Schmidt.

After calling into question the details of the Schwartz-Schmidt agreement, Bicks made the point that Google requires all kinds of licenses and permissions, including for its APIs. The implicit message is that Google has its own set of rules when it suits its business interests.

"Do you know that your APIs say that they’re copyrighted, and don’t use them for any commercial reason?" asked Bicks, showing Schmidt a copy of the AdWords terms of service. "It says, 'These are the intellectual property and proprietary information of Google. Do you see that?"

He did. Bicks showed another Google contract involving APIs.

Bicks: When you use that service, you are bound by this business document, right? Schmidt: It's essentially an automatic license. Bicks: Whatever you call it, you expect people to follow it, right? Schmidt: I do.

And then to his final point: Google is rich.

Bicks said: Google was making those deals because it was a "profitable company," right?

"We freely license Android, and we make our money on search and other applications on top of Android," Schmidt answered. "And on other platforms."

Bicks pulled up a transcript of a public earnings call in which Schmidt boasted that Android users made twice as many searches.

"That’s profit-making activity, right?" asked Bicks.

"Yes," said Schmidt.

"And—these are your words, not mine—that's 'hugely profit-making,' right?" said Bicks.

"Yes," said Schmidt.

Bicks brought up other public forums in which Schmidt expounded on Google's financial success, including an appearance on Jim Cramer's "Mad Money" television program. ("Is that the guy who always seems like he's had too much caffeine?" asked the judge.)

Finally, Bicks began to lay into Schmidt about one of his more embarrassing public statements, in which he described Google as a company that "get[s] up to the creepy line, but not crossing it."

That was cut off by US District Judge William Alsup, who wouldn't let him go past the 1:00pm cut-off for the day, despite a plea by Google's lawyer to extend the day and wrap up Schmidt's testimony.

"I know this witness is a busy man, but so are the jurors," said Alsup. "I told the jury they'll be out of here at one o'clock." Schmidt will be back on the stand tomorrow.