E.g. Armies operate hospitals for it wounded soldiers. Can your software be used in an army hospital?
E.g. What happens if private company ABC Inc. Is using your software, and then they are contracted by the military to perform work - is that allowed? You say you "want to prevent any military from legally using it" - who's using your software in this situation ... the military or private company ABC?
EDIT: and even if you figure out the exact language to restrict military use, how do you enforce it and what are the consequences of breaking it?
EDIT2: Linked below is an example to restrict military use. Note though, it's so broad reaching that it might scare away even non-military organizations for using your software. And it still doesn't address how you enforce such license. So there's lots of questions about the applicable of this example license. http://web.cs.ucdavis.edu/~rogaway/ocb/license2.pdf
EDIT3: the problem you are going to have is that you're breaking a fundamental principle of open source software. And that is that anyone can use your software so long as they do so based on your stipulations. What you want to do is restrict who can even use your software. Read the FAQ for "what is open source software". https://opensource.org/faq
E.g. Armies operate hospitals for it wounded soldiers. Can your software be used in an army hospital?
This is clear cut military use. I'm not sure why this is an example of ambiguity.
For private company it's up to their lawyers. I'm sure this is in part of why this is being done to make it harder for companies to support the military.
how do you enforce it
This is addressed in the comment? Besides which internal company lawyers will enforce it and perhaps somewhere along the line it'll be so blatant somewhere a lawyer will take up the cause and get OP a lot of money.
Then I will continue my socratic dialogue: We now have a civilian hospital that also treats soldiers if they have capacity. Should it be allowed to use the software when it treats a soldier?
What happens if private company ABC Inc. Is using your software, and then they are contracted by the military to perform work
This would likely fall under normal contract negotiation due diligence. You don't accept a contract to use a piece of software that you aren't legally allowed to use on that contract. Violating that would be ABC Inc.'s problem (though it would obviously affect the contractee). Thus, the status of your various software licenses needs to be tracked.
I worked with a vendor that had issues like this. They would need to "firewall off" not only data but also employees who were working on or with data or software that could not legally be used on another contract. This extended to seating assignments in their cubicle farm, where some people could not sit near other people who were working on conflicting contracts. The onus of staying legally compliant was taken very seriously.
Comments
What does "military use" even mean?
E.g. Armies operate hospitals for it wounded soldiers. Can your software be used in an army hospital?
E.g. What happens if private company ABC Inc. Is using your software, and then they are contracted by the military to perform work - is that allowed? You say you "want to prevent any military from legally using it" - who's using your software in this situation ... the military or private company ABC?
EDIT: and even if you figure out the exact language to restrict military use, how do you enforce it and what are the consequences of breaking it?
EDIT2: Linked below is an example to restrict military use. Note though, it's so broad reaching that it might scare away even non-military organizations for using your software. And it still doesn't address how you enforce such license. So there's lots of questions about the applicable of this example license. http://web.cs.ucdavis.edu/~rogaway/ocb/license2.pdf
EDIT3: the problem you are going to have is that you're breaking a fundamental principle of open source software. And that is that anyone can use your software so long as they do so based on your stipulations. What you want to do is restrict who can even use your software. Read the FAQ for "what is open source software". https://opensource.org/faq
This is clear cut military use. I'm not sure why this is an example of ambiguity.
For private company it's up to their lawyers. I'm sure this is in part of why this is being done to make it harder for companies to support the military.
This is addressed in the comment? Besides which internal company lawyers will enforce it and perhaps somewhere along the line it'll be so blatant somewhere a lawyer will take up the cause and get OP a lot of money.
But what if the hospital also treats sick civilians if they have capacity. Is it then allowed to use the software when treating civilians?
No, I would prefer that the license not allow it.
Then I will continue my socratic dialogue: We now have a civilian hospital that also treats soldiers if they have capacity. Should it be allowed to use the software when it treats a soldier?
This would likely fall under normal contract negotiation due diligence. You don't accept a contract to use a piece of software that you aren't legally allowed to use on that contract. Violating that would be ABC Inc.'s problem (though it would obviously affect the contractee). Thus, the status of your various software licenses needs to be tracked.
I worked with a vendor that had issues like this. They would need to "firewall off" not only data but also employees who were working on or with data or software that could not legally be used on another contract. This extended to seating assignments in their cubicle farm, where some people could not sit near other people who were working on conflicting contracts. The onus of staying legally compliant was taken very seriously.