RFR: 8269761: idea.sh missing .exe suffix when invoking javac on WSL [v2]
jvernee at openjdk.java.net
Mon Jul 5 10:40:17 UTC 2021
On Mon, 5 Jul 2021 10:31:13 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> From the JBS issue:
>> At the end, idea.sh tries to invoke javac, but when running on WSL this results in the following error:
>> bin/idea.sh: line 249: /mnt/c/progra~1/java/jdk-16/bin/javac: No such file or directory
>> Adding a .exe suffix to the javac path fixes this issue, which can be done just for WSL.
> Jorn Vernee has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase.
I realized this as well, but it doesn't look like the script works when using a linux boot JDK any way currently. The source file that is passed to `javac` is a Windows path:
JAVAC_SOURCE_FILE=`$CYGPATH -am $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
$BOOT_JDK/bin/$JAVAC$EXE_SUFFIX -d $JAVAC_CLASSES -sourcepath $JAVAC_SOURCE_PATH -cp $JAVAC_CP $JAVAC_SOURCE_FILE
So, I could change the test to look for `BOOT_JDK/bin/java.exe`, but then the script fails with:
error: file not found: H:/openjdk/git-jdk2/.idea/src/idea/IdeaLoggerWrapper.java
The rest of the script checks for `"x$WSL_DISTRO_NAME" != "x"` and then uses Windows style paths. So, I'd rather leave the current check for adding the `.exe` suffix to do the same (consistent with the rest of the script), and leave adding support for running the script with a linux boot JDK on WSL for another time, since that doesn't seem to be a quick fix.
More information about the ide-support-dev