The J-integral that determines the driving force on a crack tip is a central concept of fracture mechanics. It is particularly useful since it is path independent in homogeneous materials. However, most materials are heterogeneous at a microscopic scale, and the J-integral is not necessarily path independent in heterogeneous media. In this paper, we prove the existence of an effective J-integral in heterogeneous media, show that it can be computed from the knowledge of the macroscopic or homogenized displacement fields and that it is path independent in macroscopically homogeneous media as long as the contours are large compared to the length scale of the heterogeneities. This result justifies the common engineering use of the J-integral.