Puppies are cute. I am very sure most people I know would not deny that fact, or that many of the things they do are also incredibly cute. A little puppy dancing around your feet, trying so hard to get your attention is something many think of as utterly adorable. What is not quite so cute is when the little puppy has grown up and, say, 30kg or more of Labrador retriever is the dog jumping up and scrabbling at your thigh or crashing into your hip.
Even when the dog is smaller, many people do not like having a dog jumping up all over them, applying a liberal covering of doggy fur and drool, catching threads in their clothes, or scratching their skin. A dog jumping up, no matter their size, is showing a behaviour best replaced with something less likely to cause upset and damage to clothing, or bruising.
The method to stop jumping up is simple, but requires consistency from everyone who shares the home with the dog, and management of encounters with other people outside of the family and home. For a dog jumping up, any attention that they receive reinforces the behaviour, making it more likely that they will do it again. This means any kind of attention, whether it is fussing them or saying no and pushing them away. The dog has succeeded in gaining human attention.
When faced with a dog jumping up, simply turn away and do not engage with the dog. Ignore them entirely and keep turning away if they continue trying to jump up. As soon as all four paws are on the ground, then the dog can be rewarded, either by getting a treat or by receiving the human attention that they crave.
Once the idea of all four paws on the floor to earn attention and reward is understood by the dog, we can progress to asking the dog to sit before greeting and receiving attention. By doing this rather than the dog jumping up can make greeting people a much more comfortable and less worrying experience for everybody involved.
Dogs do what works for them, they repeat the things that get them what they like and want, whatever is desirable to that particular dog. This also means that if their actions do not result in them getting their chosen reward, but instead are ignored, the dog is more likely to discount that action, in this case jumping up, as being successful for them.