Jumping up is usually an attention-seeking or greeting behavior. The fix is consistency, not punishment.

1. Turn away and ignore

Withhold attention the instant paws leave the ground; reward four-on-the-floor.

2. Teach an incompatible behavior

A solid "sit" for greetings makes jumping physically awkward to perform.