On the settlement of Java, Adams was appointed to the command of the central division of the army, and to the important office of minister at the court of the emperor at Solo. He held this office until it was merged in the appointment of a civil commissioner to superintend the affairs of the native courts. Adams was then nominated Resident at Sourabaya, and to the command of the troops of the eastern division. The latter position, he continued to exercise at Sourabaya and at Samarang, until the general peace and restitution of Java to the Dutch.