Skip to content

Commit c134eaf

Browse files
authored
Revert "Add warning message if the Java agent is in the class path (#3960)"
This reverts commit 85bd47b.
1 parent 94ce828 commit c134eaf

File tree

1 file changed

+1
-10
lines changed
  • agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init

1 file changed

+1
-10
lines changed

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/FirstEntryPoint.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,9 @@ public void init(EarlyInitAgentConfig earlyConfig) {
122122
startupLogger.debug("JAVA_TOOL_OPTIONS: " + System.getenv("JAVA_TOOL_OPTIONS"));
123123
}
124124

125-
String classPath = System.getProperty("java.class.path");
126-
// class path null with a Spring Boot executable JAR
127-
if (classPath != null
128-
// JAR name in Maven central, the user could have renamed it
129-
&& classPath.contains("applicationinsights-agent")) {
130-
startupLogger.warn(
131-
"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.");
132-
}
133-
134125
if (startupLogger.isTraceEnabled()) {
135126
startupLogger.trace("OS: " + System.getProperty("os.name"));
136-
startupLogger.trace("Classpath: " + classPath);
127+
startupLogger.trace("Classpath: " + System.getProperty("java.class.path"));
137128
startupLogger.trace("Netty versions: " + NettyVersions.extract());
138129
startupLogger.trace("Env: " + findEnvVariables());
139130
startupLogger.trace("System properties: " + findSystemProperties());

0 commit comments

Comments
 (0)