Nigeria's Chief of Defence Staff said it was "good news for the parents," although he admitted the military would not risk "going there with force."
More than 200 girls were abducted by Boko Haram gunmen from their school in northern Nigeria in April.
Earlier, the BBC learned that a deal to release some of the girls was close but was called off by the government.
The BBC's Will Ross in Abuja says an intermediary met leaders of the Islamist group and visited the place where they were being held.
He says agreement was almost reached to release 50 of the girls in exchange for the release of 100 Boko Haram prisoners.
But the Nigerian government pulled out of the deal after President Goodluck Jonathan attended a conference on the crisis in Paris. The reasons for the withdrawal are unclear.
Nigeria's government is under pressure to do more to tackle the group and bring about the girls' release.
Thousands of people have died since Boko Haram began a violent campaign against the Nigerian government in 2009 and in the subsequent security crackdown.
Chief of Defence Staff Air Marshal Alex Badeh said on Monday that "the good news for the parents of the girls is that we know where they are" but said he couldn't reveal the location.
"But where they are held, can we go there with force? We can't kill our girls in the name of trying to get them back," he added.
Mr Badeh was addressing demonstrators who had marched to the Ministry of Defence in Abuja to protest against the government's response.
"Nobody should come and say the Nigerian military does not know what it's doing," he told the crowd. "We know what we are doing."
"The president is solidly behind us. The president has empowered us to do the work," Mr Badeh said.
The girls, who were mainly Christian, are thought to be held in a remote forested area of the north-eastern Borno state, close to the border with Chad and Cameroon.
Nigeria previously insisted it would not agree to free Boko Haram members in return for their release but the information ministry insisted that all options were on the table.
The UK, the US, China and France are among those countries to have sent teams of experts and equipment to help to locate the girls.