 The Taruma and Sunda kingdoms of western Java appeared in the 4th and 7th centuries respectively, while the Kalingga Kingdom sent embassies to China starting in 640.However, the first major principality was the Medang Kingdom that was founded in central Java at the beginning of the 8th century.Medang's religion centred on the Hindu god Shiva, and the kingdom produced some of Java's earliest Hindu temples on the Dieng Plateau.