April 5 (UPI) -- The U.S. Supreme Court on Monday ruled that Google legally used elements of Oracle's Java application programming interface when it built the Android operating system, overturning an earlier appeals court decision.
The ruling settles a long-running dispute between the two technology giants.
The court ruled by a 6-2 vote that Google's use of limited Java elements "constituted a fair use" of Oracle's Java application programming interface, or API.
"Google copied only what was needed to allow programmers to work in a different computing environment without discarding a portion of a familiar programming language," Justice Stephen Breyer wrote for the majority.
"Google's purpose was to create a different task-related system for a different computing environment (smartphones) and to create a platform -- the Android platform -- that would help achieve and popularize that objective."
The ruling is a big win for Google, which had been fighting Oracle for more than a decade.
Oracle wanted to enforce copyright over 11,500 lines in Android's code base. Google argued that it created its API's independently, while Oracle said there was a clear equivalent to Java APIs.
Oracle contended that the "structure, sequence, and organization" of Android APIs was so similar that it violated Java copyright.
A federal appeals court sided with Oracle in 2018, as did Justices Clarence Thomas and Samuel Alito on Monday.
"The court reaches this unlikely result in large part because it bypasses the antecedent question clearly before us: Is the software code at issue here protected by the Copyright Act?" Thomas and Alito wrote in their dissent.
"The majority purports to assume, without deciding, that the code is protected. But its fair-use analysis is wholly inconsistent with the substantial protection Congress gave to computer code."
Justice Amy Coney Barrett was not part of the court last October when it was argued and did not vote in the decision.