Skip to content

Commit

Permalink
Add jvm version to identifier service
Browse files Browse the repository at this point in the history
Can help for diagnosis/debugging

[Added] JVM version to identifier service

Signed-off-by: Matthew Khouzam <[email protected]>
Change-Id: Id3a59648b2389f7d143586107e0ac1718cda2c46
  • Loading branch information
MatthewKhouzam committed Nov 22, 2024
1 parent 50a643a commit 1a79fbe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class IdentifierService {
private static final String OS_NAME = "os.name"; //$NON-NLS-1$
private static final String OS_ARCH = "os.arch"; //$NON-NLS-1$
private static final String OS_VERSION = "os.version"; //$NON-NLS-1$
private static final String JVM_VERSION = "java.version"; //$NON-NLS-1$
private static final String PRODUCT_ID = "eclipse.product"; //$NON-NLS-1$
private static final String LAUNCHER_NAME = "eclipse.launcher.name"; //$NON-NLS-1$
private static final String QUALIFIER = "qualifier"; //$NON-NLS-1$
Expand Down Expand Up @@ -69,6 +70,7 @@ public Response getSystemInfo() {
response.setMaxMemory(Runtime.getRuntime().maxMemory());
response.setProductId(System.getProperty(PRODUCT_ID));
response.setLauncherName(System.getProperty(LAUNCHER_NAME));
response.setJvmVersion(System.getProperty(JVM_VERSION));

if (product != null) {
Version version = product.getDefiningBundle().getVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class ServerInfoResponseImpl {
@JsonInclude(JsonInclude.Include.NON_NULL) // Makes launcher name optional
private String launcherName;
private String productId;
private String jvmVersion;

/**
* @return Version in the format Major.Minor.Micro
Expand Down Expand Up @@ -184,4 +185,20 @@ public void setProductId(String productId) {
this.productId = productId;
}

/**
* Set JVM Version
*
* @param jvmVersion jvm version
*/
public void setJvmVersion(String jvmVersion) {
this.jvmVersion = jvmVersion;
}

/**
* @return the jvm Version
*/
public String getJvmVersion() {
return jvmVersion;
}

}

0 comments on commit 1a79fbe

Please sign in to comment.