The present study is aimed at clarifying some of the factors which affect the formation and direction of a liquid jet in a collapsing cavity and the pressures induced on a nearby rigid boundary. The flow can be accurately represented by a velocity potential leading to the use of boundary integral methods to compute bubble collapse. For configurations with axial symmetry, the jet motion and that of the bubble centroid are along the axis of symmetry. Examples are presented for bubbles close to a rigid surface and to a free surface. These are followed through to the toroidal stage after jet penetration. When there is no axis of symmetry, fully three–dimensional computations show that the buoyancy force can cause the jet to move parallel to a vertical rigid boundary, thus negating its damaging effect. The computational study is extended to model cavitation bubble growth and collapse phases in a forward stagnation point flow as a model of reattachment of a boundary layer; a region where severe cavitation damage is often observed. The Kelvin impulse is introduced to aid a better understanding of the mechanics of bubble migration and jet direction in the examples presented. Finally a comparison between the spherical and axisymmetric theories is made for an oscillating bubble in a periodic pressure field; this being of particular interest to current studies in acoustic cavitation and sonoluminescence.