-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.nio.file.InvalidPathException when using the LocalFileSystem in Windows #84
Comments
Thanks a lot for reporting this issue, I have not tested Baremaps on Windows yet. Regarding the issue, the fix does not seem to work on linux and osx: the private Path getPathFromUri(URI uri) {
if (System.getProperty("os.name").toLowerCase().contains("win")) {
return Paths.get(new File(uri).getAbsolutePath());
} else {
return Paths.get(uri.getPath());
}
} We could then add the different build target to build-ubuntu:
name: Build Project
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file pom.xml
build-macos:
name: Build Project
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file pom.xml
build-windows:
name: Build Project
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file pom.xml What do you think? If this approach suits you do not hesitate to create a PR with your changes. |
I am lacking the time for further experiments with baremaps on Windows. @bchapuis Thanks for your support and valuable feedback. Once I have more time I will revisit it. I am closing this issue. |
No problem, thank a lot your feedbacks, it really helps. If you don't mind, I will keep the issue open as not been fixed yet. Hopefully, I will eventually find time to improve support on windows. |
I can at least try to run the latest and see what happens if someone has a second to instruct me. :) I downloaded https://github.com/baremaps/baremaps/releases/tag/v0.3.2 and decompressed it to What should I do get it to run and generate vector tiles (e.g. generate vector tiles for the globe)? I see there is one file that has contents as
but I'm not sure what should that be in Windows. Maybe @bytefish got this far (tagging just in case). :) |
@veikkoeeva I am not much of a help here, sorry. I cloned the project and experimented with the CLI implementation to find out how to fix the error and probably make a PR. So I didn't use the CLI. @bchapuis can better help here. |
@veikkoeeva The current issue is solved so I created another one to track the creation of the bat script (#140). Also, notice that the project is now built on windows with github actions. |
I am working with Windows 10 and JDK 14. When using the
LocalFileSystem
in the application I run into the following exception when parsing a Windows File path passed from the CLI toLocalFileSystem
:It happens when
Path path = Paths.get(uri.getPath());
on Windows is called. I saw several similar bugs in the internet, and some fixed this by resolving the path like this:Paths.get(new File(uri).getAbsolutePath())
, but I am unsure if it also works for Mac OS and Linux`.That's why I am opening an issue instead of directly making a PR.
The
LocalFileSystem
then looks like this:The text was updated successfully, but these errors were encountered: