the headphone jack is an output not an input. that's why you can listen on headphones. try the mic input jack but you may find you need a preamp to get a usable signal.

the mic jack should work ok though if your guitar has an active pickup like an electro acoustic. not sure about passive pickups on an electric guitar and the relative strength of the signal compared to a mic.

try it -at least you'll be connected to the right jack on the pc.