Java actually originates from the island of Java in the country of Indonesia. In the late 1600s the Dutch smuggled coffee seedlings and planted them on this island. As a result, the decision to export coffee from Java led to the worldwide trade of this commodity.
In the mid 1500s the Ottoman Empire was the largest exporter of spices. As a result, traders from Europe and Asia would trade with the Ottomans, and one of those products was coffee.
During this time the Ottomans had complete control of the exportation and cultivation of coffee. Therefore coffee was a major income source and this monopoly also gave them tremendous power. In 1536, they tried to ban the exportation of coffee seedlings. However, as with most lucrative enterprises, people wanted to have access to that revenue as well.
The Dutch East India Company was a relatively small company but with big ambitions. Although they had colonies setup in India and in Indonesia, they still did not have a large control on trade. They were focused on growth and as a result they didn't care about any coffee bans and started smuggling coffee into India and Indonesia.
For this reason they attempted to grow coffee in India first, but the climate wasn't made for coffee. So in 1616 they created a coffee plantation in Sri Lanka, a really small country in South Asia. Although they were successful this time, the volume wasn't enough to be profitable.
In 1696 they took political and economical control over the island of Java, Indonesia and created coffee plantations. Indonesia proved to be a perfect place for growing coffee and in 1711 coffee was more widely introduced to Southeast Asia and then to Europe.
In summary, as coffee became a large part of the global economy, the Dutch East India Company expanded their plantations to the islands of Sumatra and Celebes (now referred to as Sulawesi) in Indonesia.
Because the trade became so lucrative in Java, coffee began to be referred to as java.