One of the national heroes of Java is Djajabaja[391] who is supposed to have lived in the ninth century. But tradition must be wrong here, for the free poetic rendering of part of the Mahabharata called Bhârata-Yuddha, composed by Mpoe Sĕdah in 1157 A.D., is dedicated to him, and his reign must therefore be placed later than the traditional date. He is said to have founded the kingdom of Daha in Kediri, but his inscriptions merely indicate that he was a worshipper of Vishṇu. Literature and art flourished in east Java at this period for it would seem that the Kawi Ramayana and an _ars poetica_ called Vṛitta-sañcaya[392] were written about 1150 and that the temple of Panataran was built between 1150 and 1175.
In western Java we have an inscription of 1030 found on the river Tjitjatih. It mentions a prince who is styled Lord of the World and native tradition, confirmed by inscriptions, which however give few details, relates that in the twelfth century a kingdom called Padjadjaran was founded in the Soenda country south of Batavia by princes from Toemapĕl in eastern Java.
There is a gap in Javanese history from the reign of Djajabaja till 1222 at which date the Pararaton[393], or Book of the Kings of Toemapĕl and Madjapahit, begins to furnish information. The Sung annals[394] also give some account of the island but it is not clear to what years their description refers. They imply, however, that there was an organized government and that commerce was flourishing. They also state that the inhabitants "pray to the gods and Buddha": that Java was at war with eastern Sumatra: that embassies were sent to China in 992 and 1109 and that in 1129 the Emperor gave the ruler of Java (probably Djajabaja) the title of king.
The Pararaton opens with the fall of Daha in 1222 which made Toemapĕl, known later as Singasari, the principal kingdom. Five of its kings are enumerated, of whom Vishṇuvardhana was buried in the celebrated shrine of Tjandi Djago, where he was represented in the guise of Buddha. His successor Śrî Râjasanâgara was praised by the poet Prapantja[395] as a zealous Buddhist but was known by the posthumous name of Śivabuddha. He was the first to use the name of Singasâri and perhaps founded a new city, but the kingdom of Toemapĕl came to an end in his reign for he was slain by Djaja Katong[396], prince of Daha, who restored to that kingdom its previous primacy, but only for a short time, since it was soon supplanted by Madjapahit. The foundation of this state is connected with a Chinese invasion of Java, related at some length in the Yüan annals[397], so that we are fortunate in possessing a double and fairly consistent account of what occurred.