diff --git a/dev/scalastyle b/dev/scalastyle
index a972811ba8ed649c55b02e678f4cc1a00ed97d67..0e8fd5cc8d64cb9d2d7fdcbd345b5545f8471fab 100755
--- a/dev/scalastyle
+++ b/dev/scalastyle
@@ -19,7 +19,8 @@
 
 echo -e "q\n" | SPARK_HIVE=true sbt/sbt scalastyle > scalastyle.txt
 # Check style with YARN alpha built too
-echo -e "q\n" | SPARK_YARN=true sbt/sbt yarn/scalastyle >> scalastyle.txt
+echo -e "q\n" | SPARK_HADOOP_VERSION=0.23.9 SPARK_YARN=true sbt/sbt yarn-alpha/scalastyle \
+  >> scalastyle.txt
 # Check style with YARN built too
 echo -e "q\n" | SPARK_HADOOP_VERSION=2.2.0 SPARK_YARN=true sbt/sbt yarn/scalastyle \
   >> scalastyle.txt