Oracle said it will appeal the decision.
Google's Android operating system is now in use on hundreds of millions of smartphones and tablets that are the main competition to Apple iPhones and iPads.
The jury hearing Oracle's lawsuit against Google had earlier ruled that use of the Java APIs was a copyright infringement, but the jury could not reach a decision on whether it was covered under "fair use" provisions contains in U.S. law.
[ Explore the complicating factors in this case. Read Java Inventor Joins Google. ]
Alsup said Google didn't use Oracle's exact programming code in Android, but rather wrote its own code to produce the same functions, according to the Associated Press. Although Google used some of the same phrases in the code, Alsup said it had to do so to maintain interoperability. The judge said names, titles, and short phrases aren't covered by copyright, and Google's use of those phrases amounted to that, the AP reported.
The decision could have major implications for the many lawsuits that have been filed in the past year or so involving software patents and copyrights. Legal experts said it will take time to fully understand the ramifications of the judge's decision.
This was the second serious blow to Oracle's case. On May 22, the jury ruled that Google didn't violate Oracle's Java patents.
The verdict that "Android does not infringe Oracle’s patents was a victory not just for Google but the entire Android ecosystem," a Google spokesperson said in an emailed statement.
Oracle said it will continue to fight. "Oracle presented overwhelming evidence at trial that Google knew it would fragment and damage Java," an Oracle spokesperson said via email. "We plan to continue to defend and uphold Java's core write once run anywhere principle and ensure it is protected for the nine million Java developers and the community that depend on Java compatibility."
Oracle filed its lawsuit against Google last August and the trial began in mid-April. Oracle initially talked about $6 billion in damages. At the moment, it appears Oracle is unlikely to win enough to cover its legal costs.
Judge Alsup isn't the only one to rule that APIs do not qualify for copyright protection. Earlier this month, the Court of Justice of the European Union ruled that neither the functionality of a computer program nor the format of its data files are expressive enough to merit copyright protection.
The Electronic Frontier Foundation argues that APIs should not be copyrightable. "Improvidently granting copyright protection to functional APIs would allow companies to dangerously hold up important interoperability functionality that developers and users rely on everyday," said EFF attorney Julie Samuels in an online post earlier this month.
At this year's InformationWeek 500 Conference C-level execs will gather to discuss how they're rewriting the old IT rulebook and accelerating business execution. At the St. Regis Monarch Beach, Dana Point, Calif., Sept. 9-11.