diff --git a/karate-core/src/main/java/com/intuit/karate/Suite.java b/karate-core/src/main/java/com/intuit/karate/Suite.java index c07c5b998..7fa65ddee 100644 --- a/karate-core/src/main/java/com/intuit/karate/Suite.java +++ b/karate-core/src/main/java/com/intuit/karate/Suite.java @@ -139,9 +139,9 @@ public Suite(Runner.Builder rb) { outputHtmlReport = false; outputCucumberJson = false; outputJunitXml = false; - var contextClassLoader = Thread.currentThread().getContextClassLoader(); + ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); if (contextClassLoader != null) { - classLoader = Thread.currentThread().getContextClassLoader(); + classLoader = contextClassLoader; } else { classLoader = getClass().getClassLoader(); }