• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 28869352089

07 Jul 2026 01:19PM UTC coverage: 72.075% (+0.009%) from 72.066%
28869352089

Pull #2128

github

web-flow
Merge 144db54d3 into 2cf3f5070
Pull Request #2128: #2123: configure Checkstyle suppression for legitimate System.out usages

4858 of 7434 branches covered (65.35%)

Branch coverage included in aggregate %.

12435 of 16559 relevant lines covered (75.1%)

3.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
cli/src/main/java/com/devonfw/tools/ide/cli/GraalVmHelper.java
1
package com.devonfw.tools.ide.cli;
2

3
import java.nio.file.Path;
4

5
import org.graalvm.nativeimage.ProcessProperties;
6

7
/**
8
 * Helper class for GraalVM.
9
 */
10
public class GraalVmHelper {
11

12
  private static final GraalVmHelper INSTANCE = new GraalVmHelper();
×
13

14
  private final boolean nativeImage;
15

16
  private GraalVmHelper() {
17

18
    super();
×
19
    String classPath = System.getProperty("java.class.path");
×
20
    this.nativeImage = ((classPath == null) || classPath.isBlank());
×
21
  }
×
22

23
  /**
24
   * @return {@code true} if IDEasy is running from a GraalVM native image, {@code false} otherwise ({@link #isJvm() running in JVM}).
25
   */
26
  public boolean isNativeImage() {
27

28
    return this.nativeImage;
×
29
  }
30

31
  /**
32
   * @return {@code true} if IDEasy is running in Java virtual machine, {@code false} otherwise ({@link #isNativeImage() running from native-image}.
33
   */
34
  public boolean isJvm() {
35

36
    return !this.nativeImage;
×
37
  }
38

39
  public Path getCwd() {
40

41
    Path cwd;
42
    if (this.nativeImage) {
×
43
      String executableName = ProcessProperties.getExecutableName();
×
44
      Path ideasyBinaryPath = Path.of(executableName).toAbsolutePath();
×
45
      Path binPath = ideasyBinaryPath.getParent();
×
46
      if (!binPath.getFileName().toString().equals("bin")) {
×
47
        // runs during native-image startup before the IDEasy logger is initialized
48
        System.out.println("WARNING: Expected native image binary to be in bin path but found " + ideasyBinaryPath); // checkstyle:ignore SystemOut
×
49
      }
50
      cwd = binPath.getParent();
×
51
    } else {
×
52
      cwd = Path.of("").toAbsolutePath();
×
53
    }
54
    return cwd;
×
55
  }
56

57
  /**
58
   * @return the singleton instance of {@link GraalVmHelper}.
59
   */
60
  public static GraalVmHelper get() {
61

62
    return INSTANCE;
×
63
  }
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc