On an NTFS volume on Windows 10 Version 1803 build 17134.523 with Developer Mode enabled, I have a file myfile
. I can make symbolic links to this file with mklink
. However, if I call Files.createSymbolicLink
on java jre 1.8.0_201
, if throws:
java.nio.file.FileSystemException: linkname: A required privilege is not held by the client.
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.createSymbolicLink(Unknown Source)
at java.nio.file.Files.createSymbolicLink(Unknown Source)
at CreateLinks.main(CreateLinks.java:15)
The same works without problems on the Windows Subsystem for Linux (WSL) with jre 1.8.0_191-8u191-b12-0ubuntu0.18.10.1-b12
How can I make this work on windows without going into WSL? And where is this exception thrown exactly?