Warner was born in Middlebury, Vermont, the son of Joseph and Jane Anne (Meech) Warner. He graduated from Kimball Union Academy in Meriden, New Hampshire in 1854, and attended Middlebury College for two years, until he was accepted as a cadet in the United States Military Academy on July 1, 1855. He graduated from West Point on July 1, 1860, standing 40th in a class of 41.
brevet 2nd Lieutenant Warner was assigned to the 10th U.S. Infantry, and, on February 28, 1861, was promoted to 2nd Lieutenant and transferred to the 8th U.S. Infantry. He was then promoted to 1st Lieutenant May 31, 1861, and assigned to Fort Wise, Colorado Territory.
Lieutenant Warner probably received a first-rate education in North-South politics while stationed at Fort Wise. Among the officers there at the start of the war were Maj. John Sedgwick, future commander of the Sixth Corps; William S. Walker, a Pennsylvanian who went with the Confederacy, probably because of his marriage to a Floridian; Richard Riddick, who would fall leading his 34th North Carolina at Gaines' Mill and William D. DeSaussure, who died at Gettysburg leading his 15th South Carolina; Edward Newby, of Virginia and James McIntyre, of Tennessee, both of whom would stay with the Union; and the redoubtable James Ewell Brown "J.E.B." Stuart, who would become the bane of many a Union cavalry trooper.
The State of Vermont asked for Warner's services to lead a volunteer regiment, which was agreed to, and he was appointed colonel on September 1, 1862, and assigned to command the 11th Vermont Infantry (also known as the 1st Artillery, Vermont Volunteers).
His regiment was assigned to the northern defenses of Washington, D.C., from September 1862 until May 1864, when Lt. Gen. Ulysses S. Grant called for more troops to support his Overland Campaign. The 11th Vermont joined the Vermont Brigade after the Battle of the Wilderness, and first saw action at the Battle of Spotsylvania Court House. In his first engagement, on May 18, 1864, Warner was severely wounded, but refused to leave the field until the end of the day. He was sent home on furlough to recover.
He returned from convalescence leave on July 8, 1864, and was assigned to command the 1st brigade, Hardin's division, XXII Corps, in the defenses of Washington. He returned to his regiment later that month, but was reassigned to command the 1st Brigade, 2nd Division, VI Corps in September 1864. He commanded that brigade until it was disbanded in May 1865.
Warner was brevetted Brigadier General, Volunteers, August 1, 1864, "for gallant and meritorious service" at the battle of Spotsylvania Court House, and at the battles of Winchester, Fisher's Hill and Cedar Creek. The regular army promoted him to captain, 8th U.S. Infantry, on October 8, 1864. He also received brevets as major, lieutenant colonel and colonel, U.S. Army, on March 13, 1865, "for gallant and meritorious service during the war." On April 9, 1865, he was brevetted Brigadier General, U.S. Army, "for gallant and meritorious services in the field during the war." Finally, he was promoted to brigadier general, volunteers, on May 8, 1865.
He mustered out of voluntary service on January 1, 1866, and resigned his regular army commission on February 13.
After the war, Warner moved to Albany, New York, where he engaged in paper manufacturing as president of the Albany Card and Paper Company. On December 19, 1889, he was appointed postmaster of Albany by President Benjamin Harrison's administration.
Warner died March 16, 1897, in New York City, and his remains were returned to Middlebury, Vermont, for interment.
James Warner married Matilda Elizabeth Allen, daughter of George Allen and Sophia Sargent, in early June 1863, while he was stationed in the northern defenses of Washington.