Martin was born in Midleton, County Cork, Ireland but emigrated with his parents to Sydney, Australia at the age of one. He was educated at Dame's School, Parramatta and, despite his family's poverty, the Sydney Academy and Sydney College under the tutelage of William Timothy Cape, and left school at the age of 16 to become a reporter.
In 1838, Martin published the Australian Sketch Book, a series of character sketches he dedicated to Sydney barrister George Robert Nichols, for whom he was then working as an articled clerk in 1840.
Martin qualified as a solicitor in 1845, and combined his legal career with employment as a newspaper editor and publisher. He married Isabella Long on 20 January 1853 and together they produced 15 children.
In 1848 Martin stood for the electorate of Durham in the New South Wales Legislative Council, but withdrew before polling day. Later in the same year he was unopposed in a by-election for the electorate of Cook and Westmoreland.
Martin was an effective legislator but his sharp tongue and intemperate speeches to the House made him few friends among his parliamentary colleagues. His most notable political achievement in his first eight years in office was to initiate the Parliamentary debate that led to the establishment of a branch of the royal mint in Sydney.
In 1856 he was elected to the first parliament under responsible government as the member for Cook and Westmoreland. He subsequently represented East Sydney, Orange, Tumut, Monaro, Lachlan and East Macquarie. In August 1856 he was made Attorney-General of New South Wales in the first ministry of Charles Cowper. The appointment was controversial, as Martin was the first holder of the post not to be a qualified barrister. The appointment was brief, as the government was defeated in a no-confidence motion in October 1856 and Martin returned to the backbench.
Martin qualified as a barrister in 1856 and was made a Queen's Counsel in 1857. He returned as Attorney General in the second Cowper Ministry in that year. However, his reputation for intemperate language continued and after a series of conflicts with fellow Ministers he resigned his post in November 1858.
In October 1863, Martin was asked by the Governor of New South Wales to form a government with a mandate to address rising State deficits and rural unemployment. As Premier and Colonial Secretary Martin promptly introduced measures to reduce immigration and increase tariffs, but was unable to secure Parliamentary support for many of his reforms. With limited achievements to its credit, the government suffered a substantial swing at the 1865 election and Martin stepped down to make way for the return of Charles Cowper.
Cowper was once again defeated in a no-confidence motion in December 1865, and in January 1866 Martin became Premier for the second time as leader of a coalition government with former rival Henry Parkes. His government resigned in October 1868, but he returned to the Premiership for a third and final time between December 1870 and May 1872.
Martin retired from Parliament in November 1873 and was immediately named to the vacant position of Chief Justice of the New South Wales Supreme Court. He held the post for 13 years, despite considerable ill health in later life.
James Martin died at home in Potts Point, Sydney on 4 November 1886 and buried in St Judes churchyard in Randwick, NSW. in 1909 his remains were moved to a new underground vault in the impressive Waverley Cemetery.
Martin was made a Queen's Counsel in 1857 and a Knight Commander of the Order of the Bath in 1869.