Starbucks Corp. has bought its first farm, with plans to use the 600-acre property in Costa Rica to develop new coffee varieties and test methods to eradicate a fungal disease known as coffee rust that is vexing the industry.

The Seattle-based coffee giant, which closed on the purchase Friday, decided to buy the farm in part because its location will allow testing of different growing methods, in order to understand what makes coffee plants thrive at different elevations. The land ranges from 3,600 to 5,500 feet above sea...