This paper considers testing the equality of multiple high-dimensional mean vectors under dependency. We propose a test that is based on a linear transformation of the data by the precision matrix which incorporates the dependence structure of the variables. The limiting null distribution of the test statistic is derived and is shown to be the extreme value distribution of type I. The convergence to the limiting distribution is, however, slow when the number of groups is relatively large. An intermediate correction factor is introduced which significantly improves the accuracy of the test. It is shown that the test is particularly powerful against sparse alternatives and enjoys certain optimality. A simulation study is carried out to examine the numerical performance of the test and compare with other tests given in the literature. The numerical results show that the proposed test significantly outperforms those tests against sparse alternatives.