For two centuries the Dutch presence in the archipelago belonged to a business. The Dutch East India Company (VOC) (VOC), founded in 1602, ran a Trading-Post Empire from Batavia (Jakarta) on Java, monopolizing the Spices of the Moluccas (Spice Islands). Corruption, war, and debt ruined it, and when its charter lapsed at the end of 1799 the Dutch state inherited its territories. This transfer is the CED's example, alongside the Congo, of a government assuming control of a colony from a non-state entity.
State rule was at first shaky. Britain occupied Java from 1811 to 1816 during the Napoleonic Wars, and the costly Java War of 1825–1830, led by the Javanese prince Diponegoro, left the colonial treasury empty. The solution was the Cultivation System introduced in 1830, which required Javanese villages to grow Coffee, Sugar, and indigo for delivery to the government. The scheme earned enormous sums for the Netherlands while contributing to hardship and famine on Java. Criticism, sharpened by the 1860 novel Max Havelaar, led to its dismantling after 1870, when the colony was opened to private planters. Tobacco and Rubber estates on Sumatra, worked by indentured Chinese and Javanese laborers, tin mines, and later Petroleum made the Indies among the most profitable colonies in the world.
Territorial control widened over the same years. The Dutch had long governed directly only on Java and a few ports; between about 1870 and 1910 they subdued the outer islands, most bloodily in the Aceh War, which began in 1873 and dragged on for three decades. The colony's final borders, those of modern Indonesia, date from this period. Rule was largely indirect, working through Javanese aristocrats and local sultans.
In 1901 the Dutch announced an Ethical Policy promising irrigation, education, and welfare. Its modest schools produced a small Western-educated elite who began to imagine a single Indonesian nation; Sukarno founded a nationalist party in 1927. Japanese occupation from 1942 destroyed Dutch prestige, and Sukarno declared independence in August 1945. After four years of fighting, the Netherlands recognized it in 1949.