Emails from Android’s earliest days showed Google and Sun at a breaking point in their negotiations over Google’s use of the Java programming languag.

Eric Schmidt, formerly Google’s CEO, gave testimony today in his company’s ongoing lawsuit with Oracle over Android. Android uses parts of the Java programming language, and Oracle claims Google is using Java in violation of several copyrights and patents. Today, Schmidt said he knew that Sun (now owned by Oracle) was trying to get paid for the use of Java in Android.

The court first looked over slides from a 2005 presentation on “Project Android” from Android creator Andy Rubin. These slides laid out Google’s plan for making money on Android: control the user experience, build mobile apps for Google services, and generate revenue from (what else?) mobile web search. Another slide noted that Google wanted to disrupt Microsoft and Sybian’s control of the mobile ecosystem (remember those days?) and that the company wanted to build a community around Android open-source APIs and apps.

At Sun, Schmidt worked on Java before it even launched. “Java was more than just a language,” he said. “It was a platform, a strategy… an attempt to build a new religion around a new way of thinking.”

Schmidt said Sun was asking for licensing fees if another company or developer wanted to use Sun’s implementation of Java. But Sun was also allowing others to fork Java without paying licensing fees.

Earlier in the trial, the Googler said he didn’t feel Google was at all obliged to pay Sun licensing fees. But in the second part of his testimony, Schmidt said Googlers thought an open, non-Microsoft mobile OS would appeal to developers and consumers and would experience explosive growth; and at first, Google was working with Sun on using Java in Android.

“You’re better off working with everyone else. You’re better off talking,” Schmidt said of those early partnership talks.

Related Coverage: Rubin’s last stand: Android founder testifies

During the talks, Sun CEO Scott McNealy, whom Schmidt called a mentor, emailed the Google Android team, saying, “I’m very supportive of driving a completely open phone stack… [then-Sun president] Jonathan [Schwartz] and I are on top of this — I’m worried about how we’re going to replace the revenue this is likely going to submarine.”

In other words, said Schmidt, “He understood the benefit of having a billion users.” But Schmidt also admitted he knew Sun wanted money — licensing fees that would help the company continue to make money on an open-source language. In fact, in an October 2006 letter, Rubin recommended that Google pay for the Sun license and release Android as open-source software.

Later, Schwartz emailed Schmidt saying the negotiations between their companies had “come to an impasse” but that both he and McNealy wanted to keep those negotiations moving forward.

“Sun is ready to embrace Google’s innovation,” read Schwartz’s email. “[But] we are not willing to cede complete control of the management… for key components of its stack.”

Google was still considering what parts of Sun technology would be used and paid for, and engineers on each side thought they could build better components for Android, to summarize Schmidt’s statements. At the end of the day, it all came down to a power struggle.

“At the highest level, the core issue had to do with control,” Schmidt concluded. “Sun’s view was that they wanted much tighter control.” Schmidt said that money was “not really” what broke the deal down. “We would have paid [the amount Sun was asking for] simply to resolve it. The money wasn’t as important as this question of making a successful platform.”

Also, as Rubin wrote in a November 2006 email, there were some concerns about the use of the GPL license for Sun’s Java APIs. “The GPL license (Sun’s license) doesn’t work for us,” Rubin wrote.

Negotiations wrapped up with no real conclusion in late 2006, Schmidt said. “We continued to talk, and eventually it became clear… that we were unable to come to a satisfactory deal.”

Instead, Schmidt said, the Google team built a ground-up operating system that didn’t incorporate Sun’s proprietary parts of Java and hence wasn’t subject to licensing fees and agreements. Whether that assertion is true — well, that’s the crux of the whole case.

However, in late 2007, Google was preparing the first Android SDK launch, Schwartz was still publicly and privately supportive of Android, ostensibly proving that Sun had no “sour grapes” symptoms over not reaching a licensing agreement and that Sun didn’t feel its copyrights or patents were being violated.

VentureBeat is reporting live from the courthouse today; all quotations are direct from the named sources.

Follow all VentureBeat’s courtroom reporting in Oracle V. Google