And when Donald J. Trump, one of the candidates with the least such experience, argued the other day for seizing the oil fields that fund the extremists, he drew a sharp, almost sarcastic rebuke from the retiring Army chief of staff, Gen. Ray Odierno, who led American troops during the worst days of the Iraq war.

Mr. Odierno cautioned Mr. Trump — and by extension other candidates — that in their eagerness to advocate force, they risk forgetting the central lesson of the Iraq and Afghan wars, which he called the need to ensure “sustainable outcomes” after American troops leave. A similar debate about short-term versus long-term results, and American strength or weakness, is playing out in the debate over the nuclear agreement with Iran signed a month ago in Vienna.

Not surprisingly, all the Republican candidates oppose it. Gov. Scott Walker of Wisconsin likes to start talks about Iran by declaring that he would “tear up” the accord on his first day in office, a line that often draws applause — as it does for at least five other candidates. But scrapping the accord would, of course, free the Iranians to do the same. So some candidates are more cautious. “I’m not one of those guys who’s going to say to you, ‘On Day 1, I will abrogate the agreement,’ ” Gov. Chris Christie of New Jersey said recently.

Almost none of the candidates say what they would replace it with, or how they would prevent Iran, once the deal was abandoned, from resuming a program that has, by the Obama administration’s own public estimates, brought it within two or three months of “breakout,” the production of one weapon’s worth of highly enriched uranium.

“I will reimpose the sanctions waived by President Obama and work with Congress to impose new crushing sanctions,” said Marco Rubio, the Florida senator whose service on the Senate Foreign Relations Committee and relentless travels around the world have given him a fluidity and confidence on national security issues often missing with the other Republican candidates. But even he has skirted the question of what good reimposing those sanctions would do if America’s negotiating partners — China, Russia and three European powers — refuse to go along.