Aji Saka
Aji Saka is a Javanese legend that tells the story of how civilization came to Java, brought by the legendary first king of Java named Aji Saka, and the mythical story of the origin of Javanese script. Origin
Aji Saka is said to have come from Bhumi Majeti, a mythical location in Jambudvipa. His name comes from the Javanese word saka or soko meaning essential, important, or in this case primordial. Thus the name Aji Saka literally means "primordial king." A more modern interpretation derives his name from the Saka or Indo-Scythian Western Satraps of Gujarat. In either case, the legend is viewed as symbolizing the advent of Dharmic Hindu-Buddhist civilization in Java. The legend also holds that Aji Saka was the inventor of the Saka year, or at least the first king that initiated the adoption of this Hindu calendar system in Java. The kingdom of Medang Kamulan was probably linked to the historical Medang Kingdom. The story of Aji Saka defeating a man-eating king has also been interpreted as the downfall of an unpopular previous ruler, the rise from cannibalism to civilization. Summary

The pacification of Java
Soon after the gods created and nailed the island of Java to its place, the island became habitable. However, the first race that ruled the island was the race of denawa (giant demons) that repressed all creatures and ate humans. The first kingdom in Java was Medang Kamulan, and the king was the Giant King Dewata Cengkar, the cruel King of the country who had a habit of eating the human flesh of his own people. One day came a young wise man, by the name of Aji Saka, to fight Dewata Cengkar. Aji Saka himself came from Bumi Majeti. One day he told his two servants, by the name of Dora and Sembodo, that he was going to Java. He told them that while he was away, both of them had to guard his Pusaka (heirloom). No one except Aji Saka himself was allowed to take the Pusaka. After arriving in Java, Aji Saka moved inland to the kingdom of Medang Kamulan. In the big battle, Aji Saka was able to push Dewata Cengkar to fall into the Javan Southern Sea (Indian Ocean). Dewata Cengkar did not die; he became a Bajul Putih (White Crocodile). Aji Saka became a ruler of Medang Kamulan. The tale of a giant snake
Meanwhile, a woman from the village of Dadapan found an egg. She put the egg in her lumbung (rice barn). After a certain period the egg vanished, and instead a snake was found in the rice barn. The villagers wanted to kill the snake, but the snake said: "I'm the son of Aji Saka, bring me to him." Aji Saka told the snake that he would be recognized as his son if he could kill the Bajul Putih in the South Sea. After a long stormy battle in which both sides demonstrated physical strength and showed skillful fighting ability, the snake was able to kill Bajul Putih. As had been promised, the snake was recognized as Aji Saka's son and he was given a name, Jaka Linglung (a stupid boy). In the palace Jaka Linglung greedily ate domestic pets of the palace. He was punished by the King, expelling him to live in the Jungle of Pesanga. He was tightly roped until he could not move his head. He was instructed only to eat things which fell to his mouth. One day, a group of nine village boys were playing around in that Jungle. Suddenly it was raining heavily. They had to find a shelter; luckily there was a cave. Only eight boys went inside the cave; the other one was suffering from a very bad skin disease, his skin was stinging and he was dirty, and he had to stay out of the cave. All of a sudden, the cave fell apart. The eight boys vanished, only the one who stayed outside was safe. The cave in fact was the mouth of Jaka Linglung. The origin of Javanese script
Meanwhile, after becoming ruler of the Medang Kamulan kingdom, Aji Saka sent a messenger back home to inform his faithful servants Dora and Sembodo, to bring the pusoko (heirloom) to Java and send them to Aji Saka. Then Dora came to Sembodo and told Aji Saka's order. Sembodo refused since he clearly remembered Aji Saka's previous order: no one except Aji Saka himself was allowed to take the pusoko. Dora and Sembodo each felt suspicious towards another, and suspecting each other tried to steal the pusoko. So they fought each other to death. Aji Saka was curious about why it was taking so long for the two to come to Java; he finally came home himself, only to discover the body of his two faithful servants and the terrible misunderstanding between them. To remember the faithful acts of his two servants, Aji Saka composed a poem that later become the origin of hanacaraka Javanese script. The Javanese alphabet itself forms a poem, and a perfect pangram, of which the line-by-line translation is as follows. :

Hana caraka There (were) two messengers 
data sawala (They) had animosity (among each other)
padha jayanya (They were) equally  powerful (in fight)
maga bathanga Here are the corpses. in detail:

hana / ana = there were/was
caraka = messenger (actually, 'one who is loyal to and trusted by someone')
data = have/has 
sawala = difference (regarding a matter) 
padha = same, equal 
jayanya = 'their power', 'jaya' could mean 'glory' as well 
maga = 'here' 
bathanga = corpses

Analysis 

Although Aji Saka is said to be the bearer of civilization on Java, the story of Aji Saka (78 AD) received several objections and rebuttal from other historical sources. Valmiki's Ramayana, made around 500 BC, records that Java already had a governmental organization long before the story:"Yawadwipa is decorated with seven kingdoms, gold and silver islands, rich in gold mines, and there is Cicira (cold) Mountain that touches the sky with its peak. "According to Chinese records, the Javanese kingdom was founded in 65 BC, or 143 years before the story of Aji Saka began. The story of Saka or Aji Saka is a Neo Javanese story. This story has not yet been found to be relevant in the Old Javanese text. This story tells of events in the Medang Kamulan kingdom in Java in the past. At that time, the king of Medang Kamulan Prabu Dewata Cengkar was replaced by Aji Saka. This story is considered as an allegory of the entry of Indians into Java. Referring to the Liang dynasty information, the Javanese kingdom was divided into two: the pre-Hinduism kingdom and the post-Hindu kingdom, which began in 78 AD. See also
Tantu Pagelaran
Wawacan Sulanjana

References

Javanese folklore
mythology