eclipse-lsp4j / lsp4j

A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.

Home Page:https://eclipse.org/lsp4j

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build with gradle on windows

ghentschke opened this issue · comments

I tried to build with gradle on my Windows machine according to this description and get the following error during: 4. Run the "eclipse assemble" gradle targets.:

java.nio.file.InvalidPathException: Illegal char <:> at index 50: C:\git_SC_202212\lsp4j\org.eclipse.lsp4j.jsonrpc\C:git_SC_202212lsp4jorg.eclipse.lsp4j.jsonrpcbuild\tmp\bnd\MANIFEST.MF
	at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
	at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
	at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
	at java.base/java.io.File.toPath(File.java:2387)
	

It seems that the Windows path C:\git_SC_202212\lsp4j\org.eclipse.lsp4j.jsonrpc cannot be correctly resolved

maybe something like
"-savemanifest": "${buildDir.path.replace("\\", "/")}/tmp/bnd/MANIFEST.MF",
helps to get bnd to deal with mix of forward and backwards slashes
or we use something to make the slashes backslashes on windows

@ghentschke I have pushed a fix which appears to solve the issue for me, both on CI (which now does Windows builds too #736) and on my local windows machine.

Please let me know if you still run into issues with working on LSP4J from source.

maybe something like "-savemanifest": "${buildDir.path.replace("\\", "/")}/tmp/bnd/MANIFEST.MF", helps to get bnd to deal with mix of forward and backwards slashes or we use something to make the slashes backslashes on windows

I couldn't get this to work, not sure what I may have been doing wrong, see #737 for my alternative.

guess the alternative is also ok as log as the build dir is not changed.
wonder why it worked on my windows.
maybe there is differences between different windows machines and locactions