In the New York store, Greene met Major Sylvanus Thayer, superintendent of the United States Military Academy, who recommended him to the Secretary of War for appointment to the academy. Greene entered West Point at age 18 and graduated second of 35 cadets in the class of 1823. Classmates of Greene's included future Union Adjutant General Lorenzo Thomas, Joseph K. Mansfield, David Hunter, Dennis Hart Mahan, and Albert Sidney Johnston. Top graduates of the academy generally chose the Engineers as their branch, but Greene decided on the artillery and was commissioned a second lieutenant in the 3rd U.S. Artillery Regiment. However, due to his excellent academic performance, he stayed at the academy until 1827 as an assistant professor of mathematics and as a principal assistant professor of engineering. One of the students he taught during this period was Cadet Robert E. Lee.