diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk index a412043bc7bbd..ca363f7cb5474 100644 --- a/make/common/JavaCompilation.gmk +++ b/make/common/JavaCompilation.gmk @@ -294,7 +294,10 @@ define SetupJavaCompilationBody # $1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch - $1_AUGMENTED_CLASSPATH += $$(BUILDTOOLS_OUTPUTDIR)/depend + # including the compilation output on the classpath, so that incremental + # compilations in unnamed module can refer to other classes from the same + # source root, which are not being recompiled in this compilation: + $1_AUGMENTED_CLASSPATH += $$(BUILDTOOLS_OUTPUTDIR)/depend $$($1_BIN) endif ifneq ($$($1_AUGMENTED_CLASSPATH), ) diff --git a/make/test/BuildMicrobenchmark.gmk b/make/test/BuildMicrobenchmark.gmk index 844c62558dac9..61c84b31a22d6 100644 --- a/make/test/BuildMicrobenchmark.gmk +++ b/make/test/BuildMicrobenchmark.gmk @@ -93,7 +93,7 @@ $(eval $(call SetupJavaCompilation, BUILD_INDIFY, \ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \ TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ SMALL_JAVA := false, \ - CLASSPATH := $(JMH_COMPILE_JARS) $(MICROBENCHMARK_CLASSES), \ + CLASSPATH := $(JMH_COMPILE_JARS), \ CREATE_API_DIGEST := true, \ DISABLED_WARNINGS := restricted this-escape processing rawtypes removal cast \ serial preview dangling-doc-comments, \