The US internet search group and software company will jointly promote the Java desktop, which runs thousands of computer programs.
Google is hoping the new deal will increase the number of users of its search engine. It will begin the partnership by promoting wider use of the Google Toolbar, which appears as a separate element in web browsers and takes users straight to the search engine.
This will be distributed automatically to the 20m computer users who download new or updated versions of Sun's Java software.
Google is also said to be looking at online tools that work with email, such as a calendar and contacts list -- features that are similar to Microsoft's Office Outlook email service.
Microsoft Office is the leading office software programme, however its Word, Excel and Powerpoint programs compete with OpenOffice equivalents.
Last year Microsoft's Office accounted for 29% of Microsoft's revenues and 41% of its operating income.
Scott McNealy, chief executive officer of Sun Microsystems, said: "As a leader in free and open source software, Sun has long recognised that network innovation is vital to the evolution of the global economy.
"Working with Google will make our technologies available more broadly, increase options for users, lower barriers, and expand participation worldwide."
The announcement, which was made from the Computer History Museum in California, was seen as a natural step for the two leading Silicon Valley giants.
Google is a member of the Java Community Process executive council and actively participates in shaping the next generation of the Java platform as part of expert groups for Java Specification Requests.
If you have an opinion on this or any other issue raised on Brand Republic, join the debate in the Forum.