-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
16, 17
The following compiles fine:
mod
|--- module-info.java // contents: 'module mod {}'
|--- pkg
|--- C.java // contents: 'package pkg; public class C {}'
classes
> javac -m mod --module-source-path . -d classes
# success
But if I replace the source directory with a symlink, javac complains about the source file location:
mod
|--- module-info.java // contents: 'module mod {}'
|--- pkg // symlink to ../pkg
pkg
|--- C.java // contents: 'package pkg; public class C {}'
classes
> javac -m mod --module-source-path . -d classes
./mod/pkg/C.java:1: error: not in a module on the module source path
package pkg;
^
1 error
I'd expect this error check to be performed against the source file's relative path (or some other symlink-preserving form of its path), not its canonical path, allowing the source tree to compile without error. Or, since the source was located by javac itself by crawling the file system, perhaps the check can be skipped entirely.
mod
|--- module-info.java // contents: 'module mod {}'
|--- pkg
|--- C.java // contents: 'package pkg; public class C {}'
classes
> javac -m mod --module-source-path . -d classes
# success
But if I replace the source directory with a symlink, javac complains about the source file location:
mod
|--- module-info.java // contents: 'module mod {}'
|--- pkg // symlink to ../pkg
pkg
|--- C.java // contents: 'package pkg; public class C {}'
classes
> javac -m mod --module-source-path . -d classes
./mod/pkg/C.java:1: error: not in a module on the module source path
package pkg;
^
1 error
I'd expect this error check to be performed against the source file's relative path (or some other symlink-preserving form of its path), not its canonical path, allowing the source tree to compile without error. Or, since the source was located by javac itself by crawling the file system, perhaps the check can be skipped entirely.
- duplicates
-
JDK-8255905 javac --module-source-path failure if symlinks are present
-
- Open
-