On 26 October, the day after the USS United States had captured HMS Macedonian, the USS Constitution left Boston along with the USS Hornet, captained by Master Commandant James Lawrence. The USS Essex, then in the Delaware River, was ordered to rendezvous with the two ships. The squadron would then raid British commerce off South America.
The squadron was commanded by Captain William Bainbridge, formerly captain of the USS Constellation, who had just taken over the Constitution from Captain Isaac Hull. who had commanded her when she captured HMS Guerriere.
The Essex‘s captain, David Porter, believed his ship to be ‘the worst frigate’ in the USN. He disliked her armament of 40 32 pound carronades and only six long 12 pounders, which left her very vulnerable to any ship that could stay out of the short range of her carronades. She was also a poor sailor, which meant that she failed to make a series of rendezvous with Bainbridge.
Bainbridge’s two ships reached San Salvador in Brazil on 13 December, where they encountered the British sloop HMS Bonne Citoyenne, which was carrying a £500,000 worth of specie. Bonne Citoyenne was originally a French ship; the British captured her in 1796 and retained her name.
Bonne Citoyenne and the Hornet both carried 18 32 pound carronades; the British ship also had two 9 pounders and the US vessel two 12 pounders. Both had crews of 150 men. They were thus evenly matched, although Theodore Roosevelt argues that US shot was about 7 per cent less than its nominal value. However, the Constitution heavily outgunned Bonne Citoyenne.
Lawrence challenged Captain Pitt Burnaby Greene of Bonne Citoyenne to a single combat, with Bainbridge promising that the Constitution would stay out of the fight. Greene declined, claiming that he was confident of beating the Hornet, but could not then expect Bainbridge to allow an enemy warship to escape unmolested. By not fighting he also tied up at least one American ship whilst protecting his cargo.
Bainbridge left the Hornet to blockade Bonne Citoyenne, and sailed the Constitution south. At 9am on 29 December she sighted two ships. They were the British frigate HMS Java, commanded by Captain Henry Lambert, and the William, an American ship that she had captured. Java, like Bonne Citoyenne, had been captured from the French, but she had been re-named; her French name was Renommée.
Lambert ordered the William to head for port, and turned Java towards the Constitution. Bainbridge initially sailed away in order to exit Portuguese territorial waters: Portugal was allied to Britain against France, but neutral in the Anglo-American conflict.
Java, a fast ship, quickly closed the range. At 1:30pm Bainbridge, confident that he was in international waters, turned towards his enemy. The two ships were half a mile apart when the Constitution opened fire at 2:10pm.
There then followed a series of manoeuvres, compared by Alfred Mahan to the feints of a fencing or boxing bout. The Constitution’s steering wheel was destroyed at 2:30pm; her rudder was intact, so she could still manoeuvre by means of tackles, but with difficulty.
By 3pm Java had lost much of her rigging, and Lambert realised that his only chance was to board the Constitution. However, Java’s foremast fell five minutes later, making her helpless. She continued to resist until 4:05pm according to the Americans, 4:35pm by British accounts. By this time Lambert had been mortally wounded and his ship had lost all her masts.
Fire then ceased, although Java continued to fly her colours. The Constitution moved away in order to repair damage. She returned at 5:25pm (5:50pm according to the British), whereupon Java hauled her colours down.
Andrew Lambert points out that the US victory was based on the same tactics as had been employed in the USN’s previous triumphs in 1812. The Americans first used their superior firepower to wreck the British ship’s masts and sails. This gave them an advantage in manoeuvrability, which they exploited to close the range and fire on the main decks, killing men and destroying guns.
As with the earlier naval actions in this war, the more powerful ship won. Lambert says that the Constitution carried 54 guns, with a total broadside of 754 tons, compared with 46 guns and 535 tons for Java.
The British ship had an inexperienced crew, but managed to damage to all three of her opponent’s masts. However, they remained standing because of their strong construction, whilst the weaker British masts were brought down by the US gunfire.
Theodore Roosevelt gives the broadsides as being 654 tons for the American ship and 576 tons for her opponent. He argues that US shot was lighter than its official weight, but the discrepancy between his figures and Lambert’s is greater than his usual discount of 7%. Roosevelt claimed that the Constitution’s broadside was 684 tons in her earlier victory over HMS Guerriere, so 654 may be a typo.
The Constitution carried 475 men. Java’s official crew was 377, but Roosevelt points out that she was taking a number of passengers to Bombay; Lieutenant-General Thomas Hislop, the new Governor-General, his staff and replacements for other RN ships. She had sailed with 446 men, of whom 20 had been transferred to the William, leaving 426 on board.
There is some doubt about the total number of casualties. Lambert gives 24 dead and 100 wounded on Java and 14 dead and 44 wounded on the Constitution. Roosevelt says that the Americans took 378 prisoners. Since there were 426 men on board Java at the start of the action, 48 must have been killed. He give the number of British wounded as 102, Captain Lambert was amongst the dead, and his First Lieutenant, Henry Chads, was badly wounded. 
Java was too badly damaged to be taken as a prize, so Bainbridge had her burnt on 31 December. He put his prisoners onshore at San Salvador. They soon returned to sea. Chads was promoted, became the RN’s leading gunnery expert and ended his career as Admiral Sir Henry Chads.
The Hornet continued to blockade Bonne Citoyenne until 24 January, when the 74 gun ship of the line HMS Montagu arrived. Greene could have come out and fought at even odds after the Constitution departed for Boston on 6 January, which she reached on 27 February, but put the safety of his cargo first.
 Quoted in A. T. Mahan, Sea Power in Its Relations to the War of 1812, 2 vols. (London: Samson Low, Marston, 1905). vol. ii, p. 1.
 T. Roosevelt, The Naval War of 1812, 2 vols. (New York, NY: Charles Scribner’s Sons, 1900-2). vol. i, p. 145
 Mahan, Sea Power 1812. vol. ii, p. 2
 A. D. Lambert, The Challenge: Britain against America in the Naval War of 1812 (London: Faber, 2012). Kindle edition, locations 1912-13 out of 12037.
 Ibid. Kindle edition, location 1897 of 12307.
 Roosevelt, Naval War, p. 155.
 These figures come from an e-book edition, so it could be that a number scanned incorrectly from the print edition.
 Roosevelt, Naval War, pp. 156-57.
 Lambert, The Challenge. Kindle edition, location 1902 of 12307; Roosevelt, Naval War. vol. i, p. 158.