 Born in what was then part of Virginia (in present-day West Virginia), Jackson received an appointment to the United States Military Academy at West Point and graduated in the class of 1846.He served in the U.S. Army during the Mexican–American War of 1846–1848 and distinguished himself at Chapultepec.From 1851 to 1861 he taught at the Virginia Military Institute, where he was unpopular with his students.