Java's contact with the European colonial powers began in 1522 with a treaty between the Sunda kingdom and the Portugese in Malacca. After its failure the Portugese presence was confined to Malacca, and to the eastern islands. In 1596, a four-ship expedition led by Cornelis de Houtman was the first Dutch contact with Indonesia. By the end of the 18th century the Dutch had extended their influence over the sultanates of the interior (see Dutch East Indies). While the Javanese were great warriors, internal conflict prevented them forming effective alliances against the Dutch. Remnants of the Mataram survived as the Surakarta (Solo) and Yogyakarta principalities. Javanese kings claimed to rule with divine authority and the Dutch helped them to preserve remnants of a Javanese aristocracy by confirming them as regents or district officials within the colonial administration.
Java major role during early part of colonial period is as producer of rice. In spice producing islands like Banda, rice was regularly imported from Java, to supply the deficiency in means of subsistence.
In 1815, there may have been 5 million people in Java. In the second half of the eighteenth century, population spurts began in districts along the north-central coast of Java, and in the nineteenth century population grew rapidly across the island. Factors for the great population growth include the impact of Dutch colonial rule including the imposed end to civil war in Java, the increase in the area under rice cultivation, and the introduction of food plants such as casava and maize which could sustain populations that could not afford rice. Others attribute the growth to the taxation burdens and increased expansion of employment under the Cultivation System to which couples responded by having more children in the hope of increasing their families' ability to pay tax and buy goods. Cholera claimed 100,000 lives in Java in 1820.
The advent of trucks and railways where there had previously only been buffalo and carts, telegraph systems, and more coordinated distribution systems under the colonial government all contributed to famine elimination in Java, and in turn, population growth. There were no significant famines in Java from the 1840s through to the Japanese occupation in the 1940s. Ethnological factors are also thought to have contributed to the increase in population. In Java, there was no absolute preference for boy babies which was significant in Java where agriculture depends on the labour of both men and women. Furthermore, the age of first marriage dropped during the nineteenth century thus increasing a women's child bearing years.
The Javanese kakawin Tantu Pagelaran explained the mythical origin of the island and its volcanic nature. Despite its large population and in contrast to the other larger islands of Indonesia, Java is comparatively homogeneous in ethnic composition. Only two ethnic groups are native to the island—the Javanese and Sundanese. A third group is the Madurese, who inhabit the island of Madura off the north east coast of Java, and have immigrated to East Java in large numbers since the 18th century. The Javanese comprise about two-thirds of the island's population, while the Sundanese and Madurese account for 20% and 10% respectively.
Four major cultural areas exist on the island: the kejawen or Javanese heartland, the north coast of the pasisir region, the Sunda lands of West Java, and the eastern salient, also known as Blambangan. Madura makes up a fifth area having close cultural ties with coastal Java. The kejawen Javanese culture is the island's most dominant. Java's remaining aristocracy are based here, and it is the region from where the majority of Indonesia's army, business, and political elite originate. Its language, arts, and etiquette are regarded as the island's most refined and exemplary. The territory from Banyumas in the west through to Blitar in the east and encompasses Indonesia's most fertile and densely populated agricultural land.
In the southwestern part of Central Java, which is usually named the Banyumasan region, a cultural mingling occurred; bringing together Javanese culture and Sundanese culture to create the Banyumasan culture. In the central Javanese court cities of Yogyakarta and Surakarta, contemporary kings trace their lineages back to the pre-colonial Islamic kingdoms that ruled the region, making those places especially strong repositories of classical Javanese culture. Classic arts of Java include gamelan music and wayang puppet shows.
Java was the site of many influential kingdoms in the Southeast Asian region, and as a result, many literary works have been written by Javanese authors. These include Ken Arok and Ken Dedes, the story of the orphan who usurped his king, and married the queen of the ancient Javanese kingdom; and translations of Ramayana and Mahabharata. Pramoedya Ananta Toer is a famous contemporary Indonesian author, who has written many stories based on his own experiences of having grown up in Java, and takes many elements from Javanese folklore and historical legends.