In distributed detection systems with wireless sensor networks, communication between sensors and a fusion center is not perfect due to interference and limited communication power of the sensors to combat noise. The problem of optimizing detection performance with imperfect communication between the sensors and the fusion center over wireless channels brings a new challenge to distributed detection. In this paper, a distributed detection system infrastructure is provided, and a multiaccess channel model is included to account for imperfect communication between the sensors and the fusion center. The J-divergence between the distributions of the detection statistic under different hypotheses is used as a performance criterion in order to provide a tractable analysis. Optimizing the performance (in terms of the J-divergence) under a total communication power constraint on the sensors is studied, and the corresponding optimal power allocation scheme is provided. It is interesting to see that, for the case with orthogonal channels, the power allocation can be solved by a weighted water-filling algorithm. Numerical results are used to illustrate the solution.