Neither the Sun nor Jupiter are "solid" masses.
Speed of impact will make a huge difference. In a very slow impact, the Sun absorbs Jupiter with little more than a hiccup.
Though I could see the sun having some flares and CMEs. If they are pointed at the Earth, the effects will range anywhere from a mild increase in the ionization of the ionosphere (better short wave communications) to a game over blast of high energy particles (kills all ungrounded/shielded electronics and electrical systems).
In a high speed impact will likely eject some mass, again the direction of this is everything.
I think @bowlturner has a serious pointserious point. Jupiter passing the Earth (with its intense magnetic field) could be a huge problem in its own right. Fortunately, space, even in the inner system, is BIG. Lots of room to slip Jupiter past us.