-
Notifications
You must be signed in to change notification settings - Fork 55
Description
Actual behavior
IDEasy supports FileAccess.link(Path source, Path link, boolean relative) to create a (symbolic) link.
Technically it does Files.createSymbolicLink(link, source) and some special logic to relativise the path if relative is true. The code is a little strange (esp. this adaptPath that might got broken on some refactoring).
However, even in cases where I fixed it, I am getting errors if the relative link path starts with .. giving me a NoSuchFileException. This really seems some kind of bug in the JDK itself that wants to verify that the parent directory of the link to create exists and the parent of .. is ../.. and JDK comes to the conclusion that this does not exist and does not resolve that against the existing file or folder to link.
Reproduce
Not easy to reproduce as a user.
this.context.getFileAccess().link(sourcePath, Path.of("../link"), true);
Expected behavior
I would still love to have some way in Java to do what ln -s sourcePath ../link is doing but due to JDK bug this seems not possible. As a workaround I found a way to make it work with mklink on windows even when using relative paths.
But it also needs to work on Linux and Mac.
As another workaround we might create absolute link in such case.
For the end user it is most important that things work at all...
However, absolute symbolic links may not be as stable and nice...
IDEasy status
IDE_ROOT is set to D:/projects
IDE_HOME is set to D:/projects/project
Your version of IDEasy is 2026.03.001-03_10_09-SNAPSHOT.
You are using a SNAPSHOT version of IDEasy. For stability consider switching to a stable release via 'ide upgrade --mode=stable'
Your version of IDEasy is 2026.03.001-03_10_09-SNAPSHOT but version 2026.03.001-20260311.030907-6 is available. Please run the following command to upgrade to the latest version:
ide upgrade
Your operating system is windows(10.0)@x64 [Windows 11@amd64]
You are online.
Found bash executable at: C:/Program Files/Git/usr/bin/bash.***
Found git executable at: C:/Program Files/Git/mingw64/bin/git.***
Your settings are up-to-date.
Successfully completed ide (status)Related/Dependent issues
Comments/Hints
I need to implement an urgent fix since this is somehow blocking #1735
Metadata
Metadata
Assignees
Labels
Type
Projects
Status