James Lawrence was born in Burlington, New Jersey, on 1 October 1781. Though educated in the field of law, he joined the infant United States Navy in September 1798 as a Midshipman and served in the ship Ganges and frigate Adams during the undeclared war with France. Commissioned in the rank of Lieutenant in 1802, he served in the schooner Enterprise during the War with Tripoli, taking part in a successful attack on enemy craft on 2 June 1803. In February 1804 he was second in command during the daring expedition to destroy the captured frigate Philadelphia. Later in the conflict he commanded the Enterprise and a gunboat in battles with the Tripolitans. He was also First Lieutenant of the frigate John Adams and, in 1805, commanded the small Gunboat Number 6 during a voyage across the Atlantic to Italy.

Subsequently, Lieutenant Lawrence commanded the warships Vixen, Wasp and Argus. In 1810 he also took part in trials of an experimental spar-torpedo. Promoted to the rank of Master Commandant in November 1810, he took command of the sloop of war Hornet a year later and sailed her to Europe on a diplomatic mission. From the beginning of the War of 1812, Lawrence and Hornet cruised actively, capturing the privateer Dolphin in July 1812. Later in the year Hornet blockaded the British sloop Bonne Citoyenne at Bahia, Brazil, and on 24 February 1813 captured HMS Peacock.

Upon his return to the United States in March, Lawrence learned of his promotion to Captain. Two months later he took command of the frigate Chesapeake, then preparing for sea at Boston, Massachusetts. She left port on 1 June 1813 and immediately engaged the Royal Navy frigate Shannon in a fierce battle. Captain Lawrence, mortally wounded by small arms fire, ordered "Don't give up the ship" as he was carried below. However, his crew was overwhelmed by British boarders shortly afterwards. James Lawrence died of his wounds on 4 June, while Chesapeake was being taken to Halifax, Nova Scotia, by her captors. His body was later repatriated to New York for burial.

The U.S. Navy has named five ships in honor of James Lawrence, including: U.S. Brig Lawrence (1813-1825); U.S. Brig Lawrence (1843-1846); USS Lawrence (Destroyer # 8); USS Lawrence DD-250; and USS Lawrence DDG-4.