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

devonfw / IDEasy / 26647192974

29 May 2026 03:48PM UTC coverage: 71.114% (+0.02%) from 71.092%
26647192974

push

github

web-flow
#1964: Fix gui not starting with older java versions (#1986)

Co-authored-by: Jörg Hohwiller <hohwille@users.noreply.github.com>

4489 of 6990 branches covered (64.22%)

Branch coverage included in aggregate %.

11629 of 15675 relevant lines covered (74.19%)

3.14 hits per line

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

20.0
cli/src/main/java/com/devonfw/tools/ide/tool/gui/Gui.java
1
package com.devonfw.tools.ide.tool.gui;
2

3
import java.nio.file.Files;
4
import java.nio.file.Path;
5
import java.util.List;
6

7
import org.slf4j.Logger;
8
import org.slf4j.LoggerFactory;
9

10
import com.devonfw.tools.ide.cli.CliException;
11
import com.devonfw.tools.ide.commandlet.Commandlet;
12
import com.devonfw.tools.ide.context.IdeContext;
13
import com.devonfw.tools.ide.process.ProcessContext;
14
import com.devonfw.tools.ide.process.ProcessContextImpl;
15
import com.devonfw.tools.ide.process.ProcessMode;
16
import com.devonfw.tools.ide.tool.ToolEditionAndVersion;
17
import com.devonfw.tools.ide.tool.ToolInstallRequest;
18
import com.devonfw.tools.ide.tool.ToolInstallation;
19
import com.devonfw.tools.ide.tool.java.Java;
20
import com.devonfw.tools.ide.tool.mvn.Mvn;
21
import com.devonfw.tools.ide.version.VersionIdentifier;
22

23
/**
24
 * {@link Commandlet} to launch the IDEasy GUI.
25
 */
26
public class Gui extends Commandlet {
27

28
  private static final Logger LOG = LoggerFactory.getLogger(Gui.class);
4✔
29

30
  /**
31
   * @param context the {@link IdeContext}.
32
   */
33
  public Gui(IdeContext context) {
34

35
    super(context);
3✔
36
    addKeyword(getName());
4✔
37
  }
1✔
38

39
  @Override
40
  public String getName() {
41

42
    return "gui";
2✔
43
  }
44

45
  @Override
46
  protected void doRun() {
47

48
    ProcessContext processContext = new ProcessContextImpl(this.context);
×
49

50
    Java java = this.context.getCommandletManager().getCommandlet(Java.class);
×
51
    Mvn mvn = this.context.getCommandletManager().getCommandlet(Mvn.class);
×
52

53
    ToolInstallRequest mavenToolInstallRequest = new ToolInstallRequest(false);
×
54
    mavenToolInstallRequest.setProcessContext(processContext);
×
55

56
    ToolInstallRequest javaToolInstallRequest = new ToolInstallRequest(mavenToolInstallRequest);
×
57
    javaToolInstallRequest.setRequested(
×
58
        new ToolEditionAndVersion(VersionIdentifier.of("25.*"))
×
59
    );
60

61
    mvn.installTool(mavenToolInstallRequest);
×
62
    ToolInstallation javaInstallation = java.installTool(javaToolInstallRequest);
×
63

64
    LOG.debug("Starting GUI via commandlet");
×
65

66
    Path pomPath = context.getIdeInstallationPath().resolve("gui/pom.xml");
×
67
    if (!Files.exists(pomPath)) {
×
68
      throw new CliException("Fatal error: The pom.xml file required for launching the IDEasy GUI could not be found in expected location: " + pomPath);
×
69
    }
70

71
    List<String> args = List.of(
×
72
        "-f",
73
        pomPath.toString(),
×
74
        "exec:exec",
75
        "-Dexec.executable=java",
76
        "-Dexec.classpathScope=compile",
77
        "-Dexec.args=-classpath %classpath com.devonfw.ide.gui.AppLauncher"
78
    );
79

80
    /*
81
     * We manually update the PATH entry with our java version, as by default IDEasy includes the SymLink under /projectname/software/java/bin in the PATH
82
     * In case of projects using older Java Versions, this is important as the java version of the project could potentially older.
83
     */
84
    mvn.runTool(processContext.withPathEntry(javaInstallation.binDir()), ProcessMode.DEFAULT, args);
×
85
  }
×
86
}
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