SAN FRANCISCO — It was a clash of billionaire tech CEOs on Tuesday as Oracle’s (ORCL) Larry Ellison and Google’s (GOOG) Larry Page appeared in a federal courtroom to testify in a high-stakes software dispute that has pitted their companies against each other.

One is older, richer and more practiced at speaking before a packed courtroom audience. The other is younger, more reclusive — and sometimes seemed to have trouble making eye contact when questioned on the witness stand.

But under intense grilling, both of the iconic Silicon Valley leaders made statements that may have helped opposing attorneys score points with the jury. Oracle is seeking nearly $1 billion in damages after claiming that Google made improper use of Oracle’s Java development tools while building the Android mobile operating system, which is now the leading smartphone platform in the world. Google has denied those claims.

Ellison, the 67-year-old Oracle founder and often pugnacious chief of the business software giant, acknowledged for the first time publicly Tuesday that Oracle had explored making its own Java-based smartphone system — and even considered buying phone-makers Research In Motion or Palm — to compete with Apple’s (AAPL) iPhone, before Oracle sued Google over its Android mobile software.

“I had the idea we could enter the smartphone business and compete,” he said.

He made the comments under questioning by Google attorney Robert Van Nest, who argued to jurors in his opening statement Tuesday morning that Oracle sued because it wanted a piece of Android’s success after failing to develop its own product.

Taking the stand later in the day, the 39-year-old Page — who co-founded Google but only recently took a more prominent role as CEO — found himself repeatedly claiming ignorance about the details of how Android was developed.

“I’m not familiar with what steps were taken, but I have no knowledge of any issues” or violations, he said in a typical response to a series of questions, posed in a highly skeptical tone by Oracle attorney David Boies. Page added, “I think we did nothing wrong.”

As the trial got under way Monday, Oracle attorney Michael Jacobs told jurors that Google infringed Java patents and copyrights that Oracle acquired when it bought Sun Microsystems, where Java was developed in the 1990s. Sun distributed the Java programming language under an open-source license, while setting conditions on the use of related programming tools.

Tuesday, Google’s Van Nest told jurors that Google didn’t need a license from Oracle or Sun because Google used only the programming language and other Java elements that were freely available in the public domain.

“It’s not about them protecting their intellectual property. It’s not about protecting the Java community,” Van Nest told jurors, referring to Oracle and its decision to file suit. “They want to share in Google’s success with Android even though they had nothing to do with Android.”

The case is being watched closely in Silicon Valley because it could have broad impact for the software industry. Java is one of the most widely used programming systems in the world, while Android is found on more smartphones than even Apple’s popular iOS.

But most of the anticipation in the packed courtroom Tuesday was focused on the testimony of Ellison and Page. In a nod to the serious nature of the occasion, both men came to court dressed uncharacteristically in dark suits and ties.

Ellison is the third-richest man in the United States, according to Forbes, which estimates his wealth at $36 billion. In that regard, he outranks Page, whom Forbes lists as the 13th-richest person in the United States, with wealth of nearly $19 billion.

No stranger to the inside of a courtroom, Ellison has launched several lawsuits on behalf of Oracle against rival tech companies over alleged theft of intellectual property. Under the gentle prompting of Oracle’s attorney, Ellison began his testimony by giving jurors an informal tutorial on software and then explained why copyrights are essential to protecting Oracle’s $5 billion annual investment in research and development.

“If people could copy our software and create cheap knockoffs of our products, we wouldn’t get paid for our engineering and wouldn’t be able to invest what we invest,” Ellison testified.

But under cross-examination by Google’s Van Nest, Ellison was forced to acknowledge he told an audience of Java developers in 2010 that “everyone should be flattered” by Android’s use of the Java language.

Later, Ellison also acknowledged that Oracle had formed an internal group to explore “Project Java Phone” in 2009 as Oracle was closing the deal to buy Sun.

“We explored it and we decided it would be a bad idea,” he said.

Ellison also said he spoke with Page and Google Chairman Eric Schmidt in 2010 about a proposal for Google to use some of Oracle’s Java components in Android. Shortly after Google balked at the proposal, Oracle filed its lawsuit.

Under further questioning, Ellison denied that his interest in developing a smartphone was related to the current lawsuit.

Before calling Ellison to testify, Oracle’s attorneys began their presentation Tuesday by playing a video of Page answering questions in a pretrial deposition. Pressed by a hostile attorney, Page appeared hesitant and chose his words carefully during the deposition, in contrast to Ellison’s confident presentation in court.

Page, who took the witness stand Tuesday afternoon, testified for less than half an hour before proceedings ended for the day. He is scheduled to return Wednesday morning.

Contact Brandon Bailey at 408-920-5022; follow him at twitter.com/BrandonBailey.