Oracle considered buying Palm and BlackBerry maker Research In Motion as part of an aborted effort to build its own smartphone, Oracle CEO Larry Ellison said in court Tuesday.

Oracle decided that RIM was too expensive and Palm wasn't competitive enough, and Oracle didn't have enough expertise in-house to develop a smartphone by itself, Ellison said.

[ InfoWorld's Neil McAllister explains why he thinks Oracle was right to sue Google. | Also on InfoWorld: How the Oracle-Google trial could affect all developers. | Stay ahead of the key tech business news with InfoWorld's Today's Headlines: First Look newsletter. | Read Bill Snyder's Tech's Bottom Line blog for what the key business trends mean to you. ]

"We explored the idea (of building a phone) and decided it would be a bad idea," he told the court.

Ellison was on the stand for the second day of Oracle's patent and copyright infringement trial against Google. Oracle accuses Google of using its intellectual property without a license to build Google's Android OS. Google says it did nothing wrong.

Ellison made his remarks under cross-examination by an attorney for Google, who was trying to convince the jury that Oracle filed its lawsuit because its own smartphone efforts had failed, and that Oracle now wants to piggyback on Android's success.

The jury also heard testimony Tuesday from Google CEO Larry Page, who was shown in a videotaped segment answering questions from one of Oracle's attorneys, David Boies. Oracle hoped to use the testimony to show the jury that Google knew it needed a Java license to develop Android.

At one point, Boies shows Page a document prepared by Google's Android team, which states that Google "must take a license from Sun." Asked about the document, Page said he was "confused" by it.

"So it's your testimony, as you sit there, that you don't understand what 'must take a license from Sun' means?" Boies asked.

"Sorry, I don't know what that refers to. It's not consistent with my understanding of Java," Page replied.

Boies: "Rubin's team was asserting that Google was required to take some kind of license from Sun, isn't that correct?"

Page: "I wouldn't agree with that statement."

Boies: "Well, does 'must' mean 'require'?"

Page: "I agree that's written but I don't agree with the statement."

Google gave its opening statement to the jury earlier Tuesday, after Oracle gave its opening statement the day before. It's now up to Oracle to prove its infringement case to the jury. Google denies any wrongdoing and will get to call its own witnesses after Oracle has made its case.

Ellison appeared relaxed when he took the stand, wearing a dark gray suit and a tie. During a break in his testimony he talked and laughed with Oracle's legal team, who occupy a table close to the jury. Google's legal team is across the room.

After being sworn in, Ellison told the court that he was born in New York City, attended public schools in Chicago and founded Oracle in 1977 as its CEO and head of engineering.

The trial is a complex one, and Oracle used part of Ellison's testimony to explain how Java includes a programming language, the Java APIs (application programming interfaces) and Java class libraries.

"Is it necessary to use the APIs to use the Java programming language?" Boies, the Oracle attorney, asked Ellison.

"Absolutely not," Ellison said.

Robert Van Nest, an attorney for Google, objected on the grounds that Ellison was providing "expert testimony," but the judge overruled him and allowed the response.

The answer to Boies' question cuts to the heart of Oracle's copyright claim against Google. The Java programming language is not covered by copyright, and Google argues that the APIs are an essential part of Java and therefore cannot be copyrighted either. Oracle disagrees.

Ellison also testified that writing APIs (application programming interfaces) is "arguably one of the most difficult things we do at Oracle."

Companies can choose from three types of Java licenses, Ellison told the jury, the open-source Gnu Public License, a specification license and a commercial license. Nokia, LG and Samsung, for example, all pay for a commercial license.

"The only company I know that hasn't taken any of these licenses is Google," Ellison said.

Under cross-examination, Van Nest pressed Ellison about Oracle's own plans to build a smartphone.

Wasn't it true, Van Nest asked, that Ellison met with Google Chairman Eric Schmidt, at Ellison's home in 2010, and proposed a joint development project to put Oracle's Java virtual machine in Android, in place of Google's, because Oracle's was faster and more efficient?

Ellison denied it was a "joint" project. "I said they could take our version of Java and put it in Android. That is not a joint project," he said.

At that point, Van Nest played video testimony from Ellison recorded earlier in which Ellison describes the work as a "joint development project." Ellison had proposed a similar project to Page some months later, Van Nest reminded him.

However, no agreement was reached, Van Nest said, and Oracle's next step was to file its lawsuit.

The trial continues Wednesday, when Oracle will call Page to give further testimony in court. The trial is expected to last eight weeks.

James Niccolai covers data centers and general technology news for IDG News Service. Follow James on Twitter at @jniccolai. James's email address is james_niccolai@idg.com.