The Trunajaya Rebellion (also spelled Trunojoyo) or Trunajaya War was a conflict in the 1670s led by the Madurese prince Trunajaya and Makassarese fighters against the Mataram Sultanate and the Dutch East India Company (VOC) in Java (in modern-day Indonesia).
The uprising was initially successful; the rebels gained Gegodog (1676), the majority of Java's north coast (1677), and the capital of Mataram (1677) from the royal army. During the retreat of the royal court, King Amangkurat I died. Amangkurat II, his son and successor, asked the VOC for assistance in exchange for cash payments and territorial concessions. The subsequent engagement of the VOC changed the course of the battle. Trunajaya was driven from Surabaya (1677) by VOC and Mataram forces, who also helped Amangkurat II reclaim lost territory and take control of Trunajaya's new capital at Kediri (1678). However, the uprising persisted until Trunajaya was captured at the end of 1679 and the other rebel leaders were overthrown, killed, or submitted (1679–1680). Amangkurat II personally executed Trunajaya in 1680 while he was a prisoner of the VOC.
After his father died in 1677, Amangkurat II also faced rival claims to the throne. The most serious rival was his brother Pangeran Puger, who took the capital Plered in 1677 and did not surrender until 1681.
Amangkurat I took the throne of Mataram in 1646, succeeding Sultan Agung, who had expanded Mataram's realm to include most of Central and East Java, as well as a few overseas vassals in southern Sumatra and Borneo. The early years of Amangkurat's reign were marked by executions and massacres against his political enemies. In response to the failed coup attempt of his brother Pangeran Alit, he ordered massacres of Islamic men who he believed were complicit in Alit's rebellion. Alit himself was killed during the failed coup. In 1659 Amangkurat suspected that Pangeran Pekik, his father-in-law and the son of the conquered Duke of Surabaya who lived at the Mataram court after Surabaya's defeat, was leading a conspiracy against his life. He ordered Pekik and his relatives killed. This massacre of East Java's most important princely house created a rift between Amangkurat and his East Javanese subjects and caused a conflict with his son, the crown prince (later Amangkurat II), who was also Pekik's grandson. Over the next few years, Amangkurat carried out several additional killings against members of the nobility who had lost his trust.
Raden Trunajaya (also spelled Trunojoyo) was a descendant of the rulers of Madura, who was forced to live in the Mataram court after Madura's defeat and annexation by Mataram in 1624. After his father was executed by Amangkurat I in 1656, he left the court, moved to Kajoran, and married the daughter of Raden Kajoran, the head of the ruling family there. The Kajoran family was an ancient family of clerics and was related by marriage to the royal family. Raden Kajoran was alarmed at the brutality of Amangkurat I's rule, including executions of noblemen at court. In 1670 Kajoran introduced his son-in-law Trunajaya to the crown prince, who had recently been banished by the king due to a scandal, and the two forged a friendship that included a mutual dislike of Amangkurat. In 1671 Trunajaya returned to Madura, where he used the crown prince's support to defeat the local governor and become the master of Madura.
Makassar was the principal trading center east of Java. After the 1669 VOC victory over the Gowa Sultanate in the Makassar War, bands of Makassarese soldiers fled Makassar to seek their fortune elsewhere. Initially, they settled in territories of the Banten Sultanate, but in 1674 they were expelled, and turned to piracy, raiding coastal towns in Java and Nusa Tenggara. The Mataram crown prince later allowed them to settle in Demung, a village in the eastern salient of Java. In 1675 an additional band of Makassarese fighters and pirates arrived in Demung led by the Kraeng of Galesong. These Makassarese itinerant fighters would later join the rebellion as Trunajaya's allies.
Lacking a standing army, the bulk of Mataram's forces were drawn from troops raised by the king's vassals, who also provided the arms and supplies. The majority of the men were peasants who were conscripted by the local lords (Javanese: sikep dalem). In addition, the army included a small number of professional soldiers drawn from the palace guards. The army used cannons, small firearms including flintlocks (Javanese: senapan, from Dutch snaphaens) and carbines, cavalry, and fortifications. Historian M. C. Ricklefs said the transfer of European military technology to the Javanese was "virtually immediate", with the Javanese manufacturing gunpowder and firearms by 1620 at the latest. Europeans were hired to train the Javanese troops in weapons handling, military leadership skills, and construction techniques, but despite this training, the conscripted peasants of the Javanese armies often lacked discipline and fled during battle. Mataram's troops numbered "much larger" than the rebel's 9,000 at Gegodog in September 1676, dropped to just "a small retinue" after the fall of the capital in June 1677, and grew to over 13,000 during the march to Trunajaya's capital at Kediri in late 1678.
The VOC had professional soldiers of its own. Each VOC soldier had a sword, small arms, cartridges, carrying pouches and belts, smoke bombs, and grenades. The majority of VOC regulars were Indonesians, with a small number of European soldiers and marines, all under the command of European officers. While in the technological sense, VOC troops were not superior to their indigenous counterparts, they generally had better training, discipline, and equipment than indigenous Indonesian armies. The VOC also maintained superior logistics; its troops marched in formation, supported by supply caravans. This gave them an advantage over Javanese troops, who often lived off the land and frequently faced supply shortages. VOC forces numbered 1,500 in 1676, but they were later augmented by Bugis allies under the leadership of Arung Palakka. The first contingent of 1,500 Bugis arrived in Java in late 1678, and by 1679 there were 6,000 Bugis troops on Java.
Similar to other belligerents, the armies of Trunajaya and his allies also used cannons, cavalry, and fortifications. When the VOC took Surabaya from Trunajaya in May 1677, Trunajaya fled with twenty of his bronze cannons and left behind 69 iron and 34 bronze pieces. Trunajaya's forces included Javanese, Madurese, and Makassarese. When the rebels invaded Java in 1676, they numbered 9,000 and consisted of Trunajaya's followers and the Makassarese fighters. Later, the rebellion was joined by other Javanese and Madurese nobles. Notably, the lord of Giri, one of the most prominent Islamic spiritual lords in Java, joined in early 1676. Trunajaya's father-in-law Raden Kajoran, head of the powerful Kajoran family, joined after Trunajaya's victory at Gegodog in September 1676, and Trunajaya's uncle the prince of Sampang (later Cakraningrat II) joined after the fall of Mataram's capital in June 1677.
Beginning and initial rebel victories
The rebellion began with Makassarese pirates from Demung village raiding trading towns along Java's northern coast. The first raid took place in 1674 in Gresik but was repulsed. In 1675, leader of the Makassarese, the Kraeng of Galesong, allied with Warlord Trunajaya through a marriage agreement, and together started planning further raids. In the same year, the Makassarese–Madurese raiders took and burned principal cities in northeast Java, from Pajarakan to Surabaya and Gresik. Given the failure of Mataram forces, King Amangkurat I appointed a military governor in Jepara, the provincial capital of the northern coast, reinforcing the town and preparing a counterattack on Demung. However, Mataram forces that marched on Demung were defeated, and combined actions by Mataram and VOC ships along the coast controlled by the raiders were not always successful. The Kraeng of Galesong moved to Madura, the domain of his ally Trunajaya. In 1676, Trunajaya gave himself the title Panembahan (Lord of) Maduretna and secured the support of the Sunan (spiritual lord) of Giri, near Gresik. A VOC fleet attack later destroyed the raiders' base in Demung, but they did not take action against Trunajaya in Madura.