Skip to content

Commit

Permalink
Fix CFPlugin for CF 2023 Windows service
Browse files Browse the repository at this point in the history
  • Loading branch information
LMarkie committed Mar 11, 2024
1 parent f9f0573 commit fd1106b
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,22 @@ private Utils() {
/**
* Are we running on a CF server.
* <p>
* By looking at the java start up command we can tell if this is a CF server.
* By checking that the coldfusion.home system property exists, or by looking at the java start up command,
* we can tell if this is a CF server.
*
* @return {@code true} if we are on a coldfusion server.
*/
public static boolean isCFServer() {
return System.getProperty("sun.java.command").contains("coldfusion");
if (System.getProperty("coldfusion.home") != null) {
return true;
}

final String javaCommand = System.getProperty("sun.java.command");
// has the potential to not exist on Windows services
if (javaCommand == null) {
return false;
}
return javaCommand.contains("coldfusion");
}

/**
Expand Down

0 comments on commit fd1106b

Please sign in to comment.