The chief executives of Oracle Corp and Google Inc took center stage in court on Tuesday as Google's lawyers argued Oracle is trying to hitch a ride on Google's success after abandoning the idea of building its own smartphone.

Oracle chief executive Larry Ellison and Google CEO Larry Page both appeared on the stand in Oracle's high stakes lawsuit against Google over the Android operating system. Ellison, 67, is a Silicon Valley veteran while Page, 39, cuts a younger and more unpolished figure.

Oracle sued Google in August 2010, saying Google's Android mobile operating system tramples its intellectual property rights to the Java programming language. Google says it does not violate Oracle's patents and that Oracle cannot copyright certain parts of Java - an open-source or publicly available software language.

I think we did nothing wrong, said Google CEO Larry Page as he testified for about 20 minutes toward the end of day two of the jury trial. He is expected to continue on Wednesday.

Oracle acquired Java when bought Sun Microsystems in 2010. In 2009, Oracle considered the feasibility of buying Blackberry maker Research in Motion and Palm to make a foray into the mobile device market, Ellison testified.

But Ellison said Oracle ultimately decided against pursuing its own phone after weeks of analysis.

He told the packed federal courtroom in San Francisco that Google was the only corporation he knew of that had not taken one of three types of Java licenses. He said other companies ranging from Samsung Electronics to Amazon.com Inc had taken licenses.

Just because something is open-source doesn't mean you can do whatever you want with it, Ellison testified.

Billionaire Ellison, clad in a conservative dark blue suit and red tie, was relaxed on the stand as Oracle attorney David Boies asked him to outline the attractions of Java for programmers. Ellison is no stranger to court, having testified in 2010 against SAP AG in a copyright lawsuit.

Ellison was then repeatedly questioned by Google's lawyer, who zeroed in on his idea to build an Oracle smartphone to battle Apple Inc and Google.

Ellison denied ever having approached Google about building smartphone software together, and said smartphones turned out to be a bad idea of his.

The idea was building the smartphone using Java FX and then charge carriers like Verizon for it, he said. Ellison said that they had debated the merits of every option to crack the smartphone market, including buying RIM, which he said was too expensive at the time, and Palm, which Hewlett-Packard ended up acquiring.

Ellison contends that in 2010, he tried to persuade Google's then-CEO Eric Schmidt and current CEO Page to take on a newer version of Java in Android, and make Android more compatible with industry standards. Those talks proved fruitless.

Ellison kept a straight face under cross examination, while Page rarely looked at Oracle attorney David Boies but instead consistently smiled at the jury as Boies delivered his questions. At one point, Boies asked Page, who was wearing a charcoal suit, if he ever inquired whether Google copied Java code for Android.

I don't recall asking anyone that, Page said.

NO INROADS

Google attorney Robert Van Nest acknowledged on Tuesday that Google executives had once negotiated for a potential partnership with Sun, before Oracle acquired it, to develop Android.

When those negotiations failed, Google engineers built Android on their own without any Sun technology whatsoever, Van Nest said in his opening argument.

The lawyer said Oracle tried but failed to make inroads into the smartphone market around 2009 or 2010 and is now trying to grab a slice of Android, which is built partly with the open Java software language pioneered by Sun.

Van Nest played a video of Ellison telling former Sun Microsystems Chairman Scott McNealy at a public event that he welcomed Google's Java devices and saw no reason Oracle-Sun should not have several of its own.

The trial before U.S. District Judge William Alsup is expected to last at least eight weeks.

The case in U.S. District Court, Northern District of California, is Oracle America, Inc v. Google Inc, 10-3561.

(Reporting By Dan Levine; Editing by Matthew Lewis, Maureen Bavdek, Tim Dobbyn and Daniel Magnowski)