A finite volume method has been formulated based on the ideal compressible potential theory. By using the continuity equation and Tait state equation as well as Riabouchinsky closure model, an "inverse problem" solution has been presented for the supercavitating flow. According to the impenetrable condition on the surface of supercavity, a new iterative method for the supercavity shape has been designed to deal with the effect of compressibility on supercavity shape and pressure field. The supercavity shape changes from ellipse to taper, as well as the drag coefficient increases with Mach number increasing. The results compare well with the experiment data and empirical formula, and the numerical method is proven to be valid.