Skip to content

Commit

Permalink
Display if server is a native binary in init message
Browse files Browse the repository at this point in the history
Adds a 'Native Image' entry to the initialization information.
If LemMinX is running as a `native-image` binary, it is set to true.

Closes eclipse#949

Signed-off-by: David Thompson <[email protected]>
  • Loading branch information
datho7561 committed Dec 21, 2020
1 parent 5908306 commit 70ac4d0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class ServerInfo {

static final String MASTER = "master";

// https:/oracle/graal/blob/master/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/SystemPropertiesSupport.java#L97
static final boolean IS_NATIVE_IMAGE = "Substrate VM".equals(System.getProperty("java.vm.name"));

private ResourceBundle rb = ResourceBundle.getBundle("git");

public ServerInfo() {
Expand Down Expand Up @@ -80,14 +83,15 @@ public String toString() {
* - Java : (path to java.home])
* - Git : ([Branch] short commit id - commit message)
* </pre>
*
*
* @return the formatted server details
*/
public String details() {
StringBuilder details = new StringBuilder();
details.append("LemMinX Server info:");
append(details, "Version", getVersion());
append(details, "Java", getJava());
append(details, "Native Image", Boolean.toString(IS_NATIVE_IMAGE));
append(details, "Git", null);
String branch = getBranch();
if (!MASTER.equals(branch)) {
Expand Down

0 comments on commit 70ac4d0

Please sign in to comment.