Skip to content

IDEasy does not warn user if IDE_ROOT is not sane #1340

@jan-vcapgemini

Description

@jan-vcapgemini

Actual behavior

As an IDEasy user I expect that IDE_ROOT always gets used properly.
If I've installed my IDEasy to D:\projects and I'm running it using a different user.dir e.g. D:\Projects IDEasy will report some strange error messages:
Undefined edition null of tool intellij
as well as create faulty plugin marker files like: plugin.eclipse.null.checkstyle.

Comment JH: I would not consider this as a bug. If you use IDEasy properly there is no such problem. You are requesting better support for edge-cases here. Your reproducer instructions tell me to break the sane installation therefore, IMHO a robustness enhancement. However, might be a PoV if bug or feature. BTW: If you want to say that our detection of the edition is a hack, I would agree but for that create a new story since this is something completely different. I was always proposing to also create an .ide.software.edition file just like .ide.software.version file or to have both in a single file. However, this could not easily be done backward compatible.

Reproduce

  1. Adjust your Windows Terminal Start directory to use your IDE_ROOT in uppercase (your actual IDE_ROOT needs to be in lower case)
    Image
  2. Create a test project e.g. ide create test -
  3. Switch to your test project e.g. icd -p test
  4. Delete plugin marker files of intellij from $IDE_ROOT/test/.ide folder
  5. Run ide -d intellij

Expected behavior

IDEasy should not report these messages and create proper plugin marker files.
IDeasy should warn the user if he uses a different CWD path than his IDE_ROOT.

IDEasy status

Updates are available for the settings repository. If you want to apply the latest changes, call "ide update"
IDE_ROOT is set to D:\Projects
IDE_HOME is set to D:\Projects\ideasy-dev
You are online.
Your settings are not up-to-date, please run 'ide update'.
Your version of IDEasy is 2025.05.002-SNAPSHOT but version 2025.05.002-20250524.024139-3 is available. Please run the following command to upgrade to the latest version:
ide upgrade
Your operating system is windows(10.0)@x64 [Windows 10@amd64]
Successfully completed ide (status)

Related/Dependent issues

No response

Comments/Hints

This seems to be related to this method:

private String getEdition(Path toolRepoFolder, Path toolInstallFolder) {
int toolRepoNameCount = toolRepoFolder.getNameCount();
int toolInstallNameCount = toolInstallFolder.getNameCount();
if (toolRepoNameCount < toolInstallNameCount) {
// ensure toolInstallFolder starts with $IDE_ROOT/_ide/software/default/«tool»
for (int i = 0; i < toolRepoNameCount; i++) {
if (!toolRepoFolder.getName(i).toString().equals(toolInstallFolder.getName(i).toString())) {
return null;
}
}
return toolInstallFolder.getName(toolRepoNameCount).toString();
}
return null;
}

which will return null if the path case did not match.
Also this line might have to be modified:
if (workingDirectory == null) {
workingDirectory = Path.of(System.getProperty("user.dir"));
} else {
workingDirectory = workingDirectory.toAbsolutePath();
}

The same issue will occur if the working directory was changed in intellij:

Image

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

Status

🏗 In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions