Lyapunov characteristic exponent is significant for analyzing nonlinear dynamics. However, most algorithms are not applicable for the switching system. According to the traditional Jacobi method, in this paper we propose a new algorithm which can be used to compute n Lyapunov exponents for an n-dimensional switching system. We first study the geometric dynamics of two adjacent trajectories near the switching manifold, and obtain a compensation Jacobi matrix caused by switching. Then with QR-decomposition of this matrix, we compensate for the diagonal vector of R to realize the Lyapunov exponent expansion. Finally, we use the algorithm in a two-dimensional double-scrolls system, the Glass network and a spacecraft power system, and show its correctness and effectiveness by comparing the results with the Poincaré-map method.