Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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