PCL2 icon indicating copy to clipboard operation
PCL2 copied to clipboard

feat(java) 搜索目标为符号链接时, 直接尝试搜索真实位置, 异常时回退到符号链接

Open lingting opened this issue 3 months ago • 2 comments

lingting avatar Sep 10 '25 03:09 lingting

umm 是遇到什么问题了么?需要这样改(

LTCatt avatar Sep 10 '25 09:09 LTCatt

@LTCatt 因为从软链接的文件夹下面搜索到的 jdk 会被 JavaSearchLoaderSub 最终处理逻辑 忽略. 所以 如果搜索目标是软链接, 直接拿真实地址搜索, 这样子搜索到的就不会被忽略了.

PCL.ModJava.JavaSearchLoaderSub 中

            Dim JavaWithoutReparse As New Dictionary(Of String, Boolean)
            For Each Pair In JavaPreList
                Dim Folder As String = Pair.Key.Replace("\\", "\").Replace("/", "\")
                Dim Info As FileSystemInfo = New FileInfo(Folder & "javaw.exe")
                Do
                    If Info.Attributes.HasFlag(FileAttributes.ReparsePoint) Then
                        Log("[Java] 位于 " & Folder & " 的 Java 包含符号链接")
                        Continue For
                    End If
                    Info = If(TypeOf Info Is FileInfo, CType(Info, FileInfo).Directory, CType(Info, DirectoryInfo).Parent)
                Loop While Info IsNot Nothing
                Log("[Java] 位于 " & Folder & " 的 Java 不含符号链接")
                JavaWithoutReparse.Add(Pair.Key, Pair.Value)
            Next

lingting avatar Sep 10 '25 10:09 lingting