Jakarta, on the island of Java, is the capital city of Indonesia. During the Dutch colonial era, it was called Batavia. In earlier forms it can be found as Djakarta
The earliest recorded mention of Jakarta is as a port of origin that can be traced to a Hindu settlement as early as the 4th century. The Jakarta area was part of the fourth century Indianized kingdom of Tarumanagara. In AD 397, King Purnawarman established Sunda Pura as a new capital city for the kingdom, located at the northern coast of Java. Purnawarman left seven memorial stones across the area with inscriptions bearing his name, including the present-day Banten and West Java provinces.
After the power of Tarumanagara declined, its territories, including Sunda Pura, became part of the Kingdom of Sunda. According to the Chinese source, Chu-fan-chi, written circa 1200, Chou Ju-kua in the early 13th Century, Srivijaya ruled Sumatra, the Malay peninsula, and western Java (Sunda). The source reports the port of Sunda as strategic and thriving, pepper from Sunda being among the best in quality. The people worked in agriculture and their houses were built on wooden piles. The harbour area was renamed Sunda Kelapa as written in a Hindu monk's lontar manuscripts. By the fourteenth century, Sunda Kelapa became a major trading port for the kingdom. The first European fleet, four Portuguese ships from Malacca, arrived in 1513 when the Portuguese were looking for a route for spices, especially black pepper. The Kingdom of Sunda made a peace agreement with Portugal by allowing the Portuguese to build a port in 1522 in order to defend against the rising power of the Sultanate of Demak from central Java.
By the 14th century, it was a major port for the Hindu Sunda Kingdom. The first European fleet, four Portuguese ships from Malacca, arrived in 1513. Malacca had been conquered by Afonso de Albuquerque in 1511 when the Portuguese were looking for spices and especially pepper.
In the 15th century AD there was, at the mouth of the Ciliwung River in the western part of Java Island, a harbour called Kalapa. It was one of the sea ports of the Sundanese kingdom of Pajajaran whose capital, Pakuan, was situated on the location of the modern city of Bogor, some 60 km upstream on the river.
The Portuguese, who had conquered Malacca in 1511 and wanted to set foot in the Moluccas, the famed "Spice Islands", were looking for a relay harbour on Java. Kalapa was attractive to them, all the more so since Pajajaran, which was still a Hindu polity, could make an alliance against Muslims who dominated the regional trade at that time. In 1522, the Portuguese signed with Pajajaran a treaty.
The relationship between the Kingdom of Sunda and Portugal intensified when another Portuguese named Enrique Leme visited Sunda in 1522 with the intention of giving a present. He was well-received and as a result, the Portuguese gained rights to build a warehouse and expand their fort in Sunda Kelapa (the name of the location at the time). The Sundanese regarded this as a consolidation of their position against the raging Muslim troops from the rising power of the Sultanate of Demak in Central Java.
In 1527, Muslim troops coming from Cirebon and Demak attacked the Kingdom of Sunda under the leadership of Fatahillah. The king was expecting the Portuguese to come and help them hold Fatahillah's army because of an agreement that had been in place between Sunda and the Portuguese. However, Fatahillah's army succeeded in conquering the city on June 22, 1557, and Fatahillah changed the name of "Sunda Kelapa" to "Jayakarta" (जयकर्; "Great Deed" or "Complete Victory" in Sanskrit).
The followers of the Sultan of Banten (the location of Jayakarta), Prince Jayawikarta, was also very involved in the history of Jakarta. In 1596, many Dutch ships arrived in Jayakarta with the intention of trading spices, more or less the same as that of the Portuguese. In 1602, the English East India Company's first voyage, commanded by Sir James Lancaster, arrived in Aceh and sailed on to Bantam where he was allowed to build trading post which becomes the centre of English trade in Indonesia until 1682. In this case, the Prince took the Dutch arrival seriously as the Dutch had constructed many military buildings. Prince Jayawikarta apparently also had a connection with the English and allowed them to build houses directly across from the Dutch buildings in 1615. When relations between Prince Jayawikarta and the Dutch later deteriorated, his soldiers attacked the Dutch fortress which covered two main buildings, Nassau and Mauritus. But even with the help of 15 ships from the English, Prince Jayawikarta's army wasn't able to defeat the Dutch, for Jan Pieterszoon Coen (J.P. Coen) came to Jayakarta just in time, drove away the English ships and burned the English trading post.
Things then changed for the Prince, when the Sultan of Banten sent his soldiers and summoned Prince Jayawikarta to establish a close relationship with the English without an approval of the Banten authorities. The relationships between both Prince Jayawikarta and the English with the Banten government then became worse and resulted in the Prince's decision to move to Tanara, a small place in Banten, until his death. This assisted the Dutch in their efforts to establish a closer relationship with Banten. The Dutch had by then changed the name to "Batavia", which remained until 1942.
In 1595, Amsterdam merchants had set up an expedition to be sent to the Indonesia archipelago. Under the command of Cornelis de Houtman, the expedition arrived in Banten in 1596. The goods it brought back to the Netherlands only produced a modest profit to the merchants who had set up the expedition.
In 1602 the Dutch set up the Dutch East Indies Company, Vereenigde Oostindie Compagnie in Dutch or VOC. In the Moluccas, the Dutch took a first Portuguese fort in 1605.