Skip to content

Commit

Permalink
Merge pull request #1480 from newrelic/1451-log-experimental-flag
Browse files Browse the repository at this point in the history
Add experimental config option to unsupported java version message
  • Loading branch information
jtduffy authored Sep 7, 2023
2 parents 8a59fad + 49e91b7 commit 3948524
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion newrelic-agent/src/main/java/com/newrelic/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public static void main(String[] args) {
System.out.println("----------");
System.out.println(JavaVersionUtils.getUnsupportedAgentJavaSpecVersionMessage(javaSpecVersion));
System.out.println("Experimental runtime mode is enabled. Usage of the agent in this mode is for experimenting with early access" +
" or upcoming Java releases or at your own risk.");
" or upcoming Java releases at your own risk.");
System.out.println("----------");
}
if (!JavaVersionUtils.isAgentSupportedJavaSpecVersion(javaSpecVersion) && !useExperimentalRuntime) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ public static String getUnsupportedAgentJavaSpecVersionMessage(String javaSpecif
.append("Please use a 6.5.3 New Relic agent or a later version of Java.");
} else if (EXCLUSIVE_MAX_JAVA_VERSION_PATTERN.matcher(javaSpecificationVersion).matches()) {
message.append("Java version is: ").append(javaSpecificationVersion).append(". ");
message.append("This version of the New Relic Agent does not support versions of Java greater than ");
message.append("This version of the New Relic Agent does not officially support versions of Java greater than ");
message.append(MAX_SUPPORTED_VERSION);
message.append(".");
message.append(".\n");
message.append("To enable support for newer versions of Java, the following environment variable or Java system property can be set:\n");
message.append("\tEnvironment variable: NEW_RELIC_EXPERIMENTAL_RUNTIME=true\n");
message.append("\tSystem property: newrelic.config.experimental_runtime=true\n");
message.append("Enabling experimental mode may cause agent issues, application crashes or other problems.");
}
return message.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private static void printExperimentalRuntimeModeInUseMessage(String javaSpecVers
System.out.println("----------");
System.out.println(JavaVersionUtils.getUnsupportedAgentJavaSpecVersionMessage(javaSpecVersion));
System.out.println("Experimental runtime mode is enabled. Usage of the agent in this mode is for experimenting with early access" +
" or upcoming Java releases or at your own risk.");
" or upcoming Java releases at your own risk.");
System.out.println("----------");
}

Expand Down

0 comments on commit 3948524

Please sign in to comment.