When military and civilian aircraft of similar speeds are compared, their engines differ mostly by their names.
It is simply too expensive to develop a civilian type in parallel to a military type when later both are used in the same way.
Examples: The B-52 engine is called J57 and was made by Pratt & Whitney.
The same company called this design JT-3C
when it was mounted to the Boeing 707 and the DC-8.
Later models used a turbofan development of the J57, the Pratt & Whitney TF33, which was called JT3D in civilian use.
The C-5A Galaxy pioneered large bypass ratio turbofans with the General Electric TF39 , which was used on the Boeing 747 , DC-10 and A300B as the CF6 later.
Even the same aircraft will sometimes use a different name for basically the same engine, depending on the use:
The T-39 Sabreliner used the J60 engine while the civilian Sabreliner called the same engine JT12 .
But even when the flight regime is different, component reuse is common between civilian and military engines: The core of the General Electric F101 (installed in the B-1A bomber, the supersonic first version of the B-1) became the CFM-56 turbofan which is used in the Boeing 737 or the Airbus A320.
Supersonic flight requires a high nozzle velocity, therefore high bypass ratios are unsuitable.
However, the differences between sub- and supersonic engines disappear the closer you move towards the gas generator core.
High-pressure compressor, combustion chamber and high pressure turbine look and work the same.
Civilian engines add a large fan in front while supersonic military engines sometimes add an afterburner.
The biggest difference, however, is in the intakes (large pitot intake with blunt lips for subsonic aircraft versus adjustable spike or ramp intakes for supersonic flight) and the nozzle (fixed for subsonic flight versus a complex, adjustable convergent-divergent nozzle for supersonic flight).
aviation.stackexchange.com/users/1961/Peter Kämpf
Two reasons: age and speed.
High bypass turbofans have only been in existence since the 70s -
the B-52 was one of the first mass-produced jet powered military aircraft, and turbofans were simply not around at the time.
Same for the U-2. Many fighter aircraft go supersonic, and jet engine thrust T is defined as $T
= \dot{m}
\cdot
(V_e - V_0)$, with $V_0$ the airspeed.
Exhaust velocity $V_e$ must be higher than true airspeed in order to generate thrust, and turbojets have a much higher exhaust flux velocity than the cold stream of the turbofan.
Image source Pure turbojets are noisy and thirsty, and modern fighters use low bypass jet engines with mixed exhaust streams, like the one depicted above.
This configuration still allows for the use of afterburners:
take-off thrust is where high bypass turbofans are particularly strong.
aviation.stackexchange.com/users/21091/Koyovis
I agree with all of the answers posted so far, particularly regarding supersonic speed.
Let me add another perspective: Differences in priorities.
The major factors influencing engine design are: cost, weight, fuel efficiency, and response time (how long from when the pilot moves the throttle to when you have full thrust), and maintainability.
Both military and commercial operators care about all of these, but they differ on which one is most important.
To a commercial operator, fuel efficiency trumps everything else, hands down.
The fuel bill for a large airline can run in the billions of dollars per year, so saving even 0.1% fuel efficiency is worth a lot to them.
That's why you see high bypass turbo fans on all commercial jet liners.
That configuration is the most fuel efficient.
The tradeoff is that once the pilot pushes the throttle, it takes a couple of seconds for that huge fan to spin up.
Airlines are willing to live with that in exchange for better fuel efficiency.
The military does care about fuel efficiency, but they also care about response time.
When a fighter pilot wants thrust, he wants thrust
right now and the cost is secondary.
Waiting a few seconds for the engine to respond could be the difference between life and death.
That's why you see afterburners on fighter jets.
Afterburners are great at giving you a huge amount of thrust very quickly.
But they are huge gas guzzlers
so you would never put them on a commercial jet liner.
aviation.stackexchange.com/users/18736/Daniel K
It isn't universally true that military and commercial aircraft use different engines.
The military and commercial versions of the Boeing 707/C135 used similar engines as do the military and commercial versions of the DC10.
Combat aircraft however are usually powered by low bypass turbofan engines rather than the high bypass turbofans used in commercial jetliners.
The low bypass engines are less fuel efficient but are more compact and have a higher thrust-to-weight ratio than the high bypass engines as well as including an afterburner which can be used to increase thrust at critical periods although at the expense of even greater fuel consumption.
The design of the Lockheed SR71 "Blackbird" reconnaissance aircraft featured turbo-ramjet engines which at high speeds generated most of their thrust in the bypass ducts surrounding the central turbojet engine, using the ramjet principle in which the incoming air is compressed by ram pressure alone without the use of a compressor.
The requirement for supersonic maximum speeds has traditionally been a major factor determining the choice of engines for combat, although such speeds have in practice only been routinely used by reconnaissance aircraft, most notably the SR71.
Most manned fighters use so much fuel in afterburner that this capability is rarely used except for takeoff and when manouvering at high g factors, when the extra thrust is needed to counteract drag induced at high angles of attack (AOA).
The F22 Raptor however has a "supercruise" capability of achieving supersonic speed without the use of afterburner.
aviation.stackexchange.com/users/26711/J. Southworth
The B-52 and U-2 are not the best examples, both are 60 year-old designs which use 60 year-old engine designs.
The first turbofan flew in 1952 , but it took a while for turbofans to become common.
In 1961, the B-52H became the first B-52 to have turbofans.
By the 1970s , turbofans were used in fighters too.
Modern supersonic fighters use turbofans, for example the F-22 uses the P&W F-119 engine which has a bypass ratio of 0.25.
This engine can drive the F-22 at supersonic speeds without using its afterburner.
aviation.stackexchange.com/users/11395/Hobbes
Why do most military aircraft and helicopters use different engine technology (fighters, B52, U2, etc) than most commercial aircraft?[I removed the use of axial terminology]
Why do most military aircraft use different engines than commercial aircraft?
aviation.stackexchange.com
<jet-engine>
aviation.stackexchange.com/questions/46674
aviation.stackexchange.com/users/25735/jwzumwalt
It isn't universally true that military and commercial aircraft use different engines. When military and civilian aircraft of similar speeds are compared, their engines differ mostly by their names. But even when the flight regime is different, component reuse is common between civilian and military engines:   The core of the  General Electric F101  (installed in the B-1A bomber, the supersonic first version of the B-1) became the  CFM-56  turbofan which is used in the Boeing 737 or the Airbus A320.  It is simply too expensive to develop a civilian type in parallel to a military type when later both are used in the same way. It is not entirely true that they use different engines: sometimes military engines are reused in commercial aircraft, or their engines differ only in name. However, where there is a difference, it is due to the age and speed. Military aircraft must reach supersonic speeds, so they must have the appropriate engines. Also, these two types of aircraft have different priorities. For commercial airlines, fuel efficiency is their main concern. The military cares more for response time than for fuel efficiency.
It is not entirely true that they use different engines: sometimes military engines are reused in commercial aircraft, or their engines differ only in name. There is a difference due to the age and speed. Military aircraft must reach supersonic speeds, so they must have the appropriate engines. These two types of aircraft have different priorities. For commercial airlines, fuel efficiency is their main concern. The military cares more for response time than for fuel efficiency.