The only thing that matters is the best 5 cards.
So Player 1 can make J-7, while at the same time Player 2 can make 10-6 and pair of 6.
Player's 1 best hand is straight J-7. That is the ONLY thing we consider.
Player's 2 best hand is straight 10-6. That is the ONLY thing we consider. The pair of 6 is not considered.
Player 1's J-7 beats Player 2's 10-6, so player 1 wins.
When in doubt, remembers this: only the best hand you consider...even in tie
If the best hand of both player is the same, then split the pot. Don't consider the second best hand or whatsoever.
More at: How to determine the winning hands in poker?