If you would draw a card while your library has no cards in it, you win the game instead.
[+1]: Target player mills two cards. Draw a card.
[−8]: Draw seven cards. Then if your library has no cards in it, you win the game.
Follow the instructions in the order listed on Jace’s first loyalty ability: if you target yourself, you’ll put the top two cards of your library into your graveyard and then draw a card.
If for some reason you can’t win the game (because your opponent controls Platinum Angel, for example), you won’t lose for having tried to draw a card from a library with no cards in it. The draw was still replaced.
If the target player is an illegal target when Jace’s first loyalty ability tries to resolve, it doesn’t resolve. You won’t draw a card.
If two or more players control Jace, Wielder of Mysteries and each player is instructed to draw a number of cards, first the player whose turn it is draws that many cards. If this causes that player to win the game instead, the game is immediately over. If the game isn’t over yet, repeat this process for each other player in turn order.
If your library has fewer than seven cards in it while resolving Jace’s last ability, and Jace has already left the battlefield, you’ll draw as many cards as you can and then win the game before state-based actions would cause you to lose the game for trying to draw from an empty library.