Juan Fernández de Heredia was a Spanish knight of Aragon who served as Grand Master of the Knights Hospitaller from 24 September 1377 to his death. His tenure was occupied by the "affair of Achaea", the persistent, but ultimately fruitless, efforts by the Knights to acquire the Principality of Achaea in southern Greece. He was also a great patron of the translation and composition of historiographical works in the Aragonese language and a counsellor to two Kings of Aragon.
In 1376, Heredia conducted the fleet bearing Pope Gregory XI back to Rome, presaging the end of the Avignon Papacy. The next year, on September 24, Gregory formally appointed Heredia grand master, following the death of Robert of Juilly on July 27. Heredia embarked from Naples for Romania late in 1377, arriving in Vonitsa in April 1378. Heredia immediately set about to take Arta but was captured by Ghin Boua Spata, lord of Aetolia and Acarnania, and sold to the Ottoman Turks. He was quickly ransomed, for he was in Glarentsa on 20 May 1379, though during his absence, his commandant, Gaucher of La Bastide, hired the Navarrese Company of mercenaries and brought them to the Principality of Achaea for eight months. After his release, Heredia went to Rhodes, the headquarters of the order, in July. Power was readily ceded to him, as he was an adherent of the Avignonese Pope Clement VII. Heredia tried to make a deal to have the Navarrese turn over the castles they were holding in the name of the prince to the military order. The Navarrese' preponderant demands, however, quickly sunk any possible agreement. Heredia ignored the powerful company and instead dealt directly with Marie of Blois, who claimed the principality on behalf of her son Louis II of Naples. Marie signed over her son's rights to the order on 24 January 1387, with the consent of Clement VII. The transaction cost the order 20,000 gold florins. Later, the pope reversed his endorsement at the request of the Achaean claimant Amadeus, Lord of Pinerolo. . Despite these failures with the Navarrese, Heredia had continued to use them in his war. Though Peter IV had forbid any Hospitallers of his realm to travel with Heredia east, he himself had claimed the rights to the Duchy of Athens. The Navarrese, under Juan de Urtubia, attacked Thebes, the capital of the duchy, and Heredia, though friendly with the king, was warned in a letter to stop abetting his enemies.
Heredia spent most of his life in Avignon after 9 April 1382, when he embarked for the West with his powers diminished some by the untrusting convent in Rhodes. In April 1383, the Roman Pope Urban VI appointed Riccardo Caracciolo, prior of Capua, anti-master in opposition to Heredia. Caracciolo had the support of some Italian priories, of the England and other Urbanist regions, but his power was insignificant by his death in 1395, after which no one was elected to replace him. Heredia did not long survive him and was succeeded by Philibert of Naillac. Heredia was wealthy and learned, a patron of historiography and translation. It was he who ordered the Chronicle of Morea translated into Aragonese sometime before 1393, though it does not contain any mention of his term of service in the Morea. The medieval stonework of his fortified castles in Mora de Rubielos and Rubielos de Mora has been much studied in the last few years. He was buried in Caspe. His tomb was destroyed by anarchist soldiers during the Spanish Civil War, although some photographs remain.