The CEOs of Oracle and Google met for six hours on Friday but failed to reach a deal to end their massive copyright lawsuit over Google's use of Java in Android.

"After an earlier run at settling this case failed, the court observed that some cases just need to be tried. This case apparently needs to be tried twice," Magistrate Judge Paul Singh Grewal, who mediated the talks, noted on the court's docket.

Oracle accuses Google of illegally copying a key part of the Java platform into its Android operating system, making billions in profit for Google and, according to Oracle, crushing Java’s chance of success in smartphones, tablets and other products.

Google denies any wrongdoing. It argues that its use of Java is protected by the legal doctrine of "fair use," which permits copying in some circumstances.

The two sides have already been to court over the matter once, but the jury failed to reach agreement on fair use. A new trial is scheduled to begin next month.

Oracle plans to tell the jury it's entitled to $8.8 billion in damages, based on profits that Google has made from its use of Java in Android, mostly from ads sold against mobile searches.

Google is fighting to get that figure reduced before the case comes to trial, however. Lawyers for the two sides appeared before trial Judge William Alsup this week, arguing over which arguments each side should be able to make to the jury.

At the close of Thursday's hearing, Alsup reminded the companies' lawyers of the risks they bear in taking such a high-stakes case to trial.

“At the end of the trial, one of you — I don’t know who — will go walking through those double doors with your arm around the client, explaining why you lost,” Alsup said, motioning to the back of his courtroom on the 19th floor of the federal courthouse in San Francisco.

“One of you is going to be in that position at the end,” he said. “There’s always appeals, but nevertheless you’ll have to go through those double doors with your arm around your client, who will be in shock that they didn’t win, and you’ll be having to try to comfort them and comfort yourself.”

“That’s a hard moment for a trial lawyer, to be in that position,” he said.