Military usage of scientific work
I don't think you have any right to restrict the usage of your publications. You might retain the original copyright (or your publisher will), and thus prevent that anyone else (including the army) can publish your work on their behalf, but you can't prevent someone to use your idea just because it's published. 

A legal possibility could be to file a patent protecting your approach, but I'm not sure if it covers all usage or only commercial usages (in which case the army could use it as long as they are not making money out of it). You might want to check this with AskPatent. 

You could also not publish it, and it could be possible to ask your university to consider your thesis as confidential (I've seen some cases where a thesis was confidential, when some companies were involved in them), but your advisor might not agree.