This paper proposes the Forest U-Test, a novel method for studying the influence of multiple genetic variants, environmental risk factors, and their interactions on the variation in complex traits. To overcome the limitations of existing methods, which involve exponentially increasing feature spaces and computational intensity, we employ a random forest approach based on the U-statistic. Simulations demonstrate that our method outperforms existing methods and, when applied to a study of cannabis dependence (CD), detects significant joint associations (p-value < 0.001) in three independent datasets. These results are also replicated in two independent datasets (p-values of 5.93e-19 and 4.70e-17, respectively).