diff --git a/jaxp/make/Makefile b/jaxp/make/Makefile
index e8ea3347b31..fc1f3010046 100644
--- a/jaxp/make/Makefile
+++ b/jaxp/make/Makefile
@@ -69,6 +69,14 @@ else
endif
endif
+ifeq ($(DEBUG_CLASSFILES), true)
+ ANT_OPTIONS += -Djavac.debug=true
+ ANT_OPTIONS += -Djavac.debuglevel=source,lines,vars
+else
+ ANT_OPTIONS += -Djavac.debug=false
+ ANT_OPTIONS += -Djavac.debuglevel=
+endif
+
# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
# and the somewhat misnamed CLASS_VERSION (-target NN)
ifdef TARGET_CLASS_VERSION
diff --git a/jaxp/make/build.xml b/jaxp/make/build.xml
index 6aeb6731d09..277e0c9ed72 100644
--- a/jaxp/make/build.xml
+++ b/jaxp/make/build.xml
@@ -85,6 +85,7 @@
destdir="${build.classes.dir}"
memoryInitialSize="${javac.memoryInitialSize}"
memoryMaximumSize="${javac.memoryMaximumSize}"
+ debug="${javac.debug}"
target="${javac.target}">