After months of tentative talks and rejected offers, Oracle and Google are finally heading to court in a lawsuit that puts the fate of the Android operating system in the balance.

In a memo penned today (which we’ve embedded below), Magistrate Judge Paul S. Grewal wrote that Google and Oracle had reached an irreconcilable impasse in their talks and, “In the end, some cases just need to be tried,” wishing both companies luck as their trial begins in San Francisco on Monday, April 16.

Oracle first filed suit against Google in 2010 claiming the search company had infringed on Java-related intellectual property.

Java is the programming language that forms the backbone of Android, Google’s blockbuster success of a mobile operating system. The Java IP in question, including a slate of specific copyrights and patents, had only recently been transferred to Oracle when that company finalized its acquisition of Sun Microsystems in early 2010.

An Oracle victory in court could add up to billions in damages, and given that Google’s revenue per device is quite low — perhaps adding up to less than $550 million since Android’s debut in 2008 — any per-device licensing fee would put a damning dent in Google’s Android revenue.

Googlers have previously and repeatedly reassure VentureBeat that Android is not going anywhere anytime soon. “From a consumer standpoint, consumers should not be concerned about losing their Android phone,” a Google spokesperson said in a recent phone chat. “There’s no indication that Android is under threat… We’re actively pushing back on Oracle to preserve choice in the marketplace in the long term.”

Still, as Oracle — an unquestioned heavyweight in the patents department — and Google head to court, it’s hard not to cringe a bit when we think about how Android could get mangled in the process.

We’ve reached out to Google for an update on the lawsuit and will keep you posted as this story develops.