NotFormer: How do the JWs get around this?
It depends on who was making the rules at any given moment. There have been times when it was okay to do anything short of enlisting, and there have been times when even providing products or services to a military base was forbidden. Ray Franz described this in Crisis of Conscience, when he explained how one brother had a job delivering drinks to different businesses and to a military base. The GB, at the time, decided that this was immoral and the brother decided to look for work elsewhere.
When I was 18, I registered for the selective service, which made me eligible for the draft in the USA. This was not considered immoral. Had I been drafted, I was expected to refuse to serve and accept any consequences of that stance. I think that this was less of an issue by that time (1986), as the US military had realized that draftees tended to be of such low quality as to be better off left alone.
But always remember, you can justify a broad range of directives by selecting some Bible verses and omitting others.