Skip to content

Commit 3235f3a

Browse files
committed
do not use module opener for java < 9
1 parent ab4662c commit 3235f3a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/instrumentation/InstrumentationModuleInstaller.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import net.bytebuddy.description.annotation.AnnotationSource;
4444
import net.bytebuddy.description.type.TypeDescription;
4545
import net.bytebuddy.matcher.ElementMatcher;
46+
import net.bytebuddy.utility.JavaModule;
4647

4748
public final class InstrumentationModuleInstaller {
4849

@@ -213,7 +214,8 @@ private AgentBuilder installInjectingModule(
213214
.transform(ConstantAdjuster.instance())
214215
.transform(
215216
(builder, typeDescription, classLoader, module, protectionDomain) -> {
216-
if (instrumentationModule instanceof ExperimentalInstrumentationModule
217+
if (JavaModule.isSupported()
218+
&& instrumentationModule instanceof ExperimentalInstrumentationModule
217219
&& !openerRun.get()) {
218220
ExperimentalInstrumentationModule experimentalModule =
219221
(ExperimentalInstrumentationModule) instrumentationModule;

0 commit comments

Comments
 (0)