-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
17.0.8
Logging this issue for record purposes.
The javac behaviour change seen exists since JDK 9. One such summary of the change is available here: https://mail.openjdk.org/pipermail/compiler-dev/2016-November/010544.html
Specifying the output directory via the javac "-d" directive should resolve the issue reported.
mkdir symLinkTest
cd symLinkTest
mkdir readOnlyDir
echo "public class Hello {}" > readOnlyDir/Hello.java
ln -s readOnlyDir/Hello.java
chmod 555 readOnlyDir
/jdk1.8.0_381/bin/javac Hello.java
--> Hello.class created in symLinkTest directory
With JDK 9 or later:
$ /jdk-11.0.16/bin/javac Hello.java
Hello.java:1: error: error while writing Hello: /tmp/symLinkTest/readOnlyDir/Hello.class
public class Hello {}
^
1 error
following works:
$ /jdk-11.0.16/bin/javac -d . Hello.java
The javac behaviour change seen exists since JDK 9. One such summary of the change is available here: https://mail.openjdk.org/pipermail/compiler-dev/2016-November/010544.html
Specifying the output directory via the javac "-d" directive should resolve the issue reported.
mkdir symLinkTest
cd symLinkTest
mkdir readOnlyDir
echo "public class Hello {}" > readOnlyDir/Hello.java
ln -s readOnlyDir/Hello.java
chmod 555 readOnlyDir
/jdk1.8.0_381/bin/javac Hello.java
--> Hello.class created in symLinkTest directory
With JDK 9 or later:
$ /jdk-11.0.16/bin/javac Hello.java
Hello.java:1: error: error while writing Hello: /tmp/symLinkTest/readOnlyDir/Hello.class
public class Hello {}
^
1 error
following works:
$ /jdk-11.0.16/bin/javac -d . Hello.java