From c134eaf122ede00d47b77121815e6783a3a435f6 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Tue, 21 Jan 2025 18:46:33 -0800 Subject: [PATCH] Revert "Add warning message if the Java agent is in the class path (#3960)" This reverts commit 85bd47b1d820546872519cadca9eec2e19048253. --- .../agent/internal/init/FirstEntryPoint.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/FirstEntryPoint.java b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/FirstEntryPoint.java index 45c69a3fff8..025cba19e94 100644 --- a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/FirstEntryPoint.java +++ b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/FirstEntryPoint.java @@ -122,18 +122,9 @@ public void init(EarlyInitAgentConfig earlyConfig) { startupLogger.debug("JAVA_TOOL_OPTIONS: " + System.getenv("JAVA_TOOL_OPTIONS")); } - String classPath = System.getProperty("java.class.path"); - // class path null with a Spring Boot executable JAR - if (classPath != null - // JAR name in Maven central, the user could have renamed it - && classPath.contains("applicationinsights-agent")) { - startupLogger.warn( - "The applicationinsights-agent JAR is in the class path. You should remove it because it could lead to unexpected results. You should configure the Java agent with -javaagent. You can also use the runtime attachment with Spring Boot applications."); - } - if (startupLogger.isTraceEnabled()) { startupLogger.trace("OS: " + System.getProperty("os.name")); - startupLogger.trace("Classpath: " + classPath); + startupLogger.trace("Classpath: " + System.getProperty("java.class.path")); startupLogger.trace("Netty versions: " + NettyVersions.extract()); startupLogger.trace("Env: " + findEnvVariables()); startupLogger.trace("System properties: " + findSystemProperties());