Skip to content
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 Path Spaces Error for Java Maven Project #647

Closed
JoelProminic opened this issue Dec 30, 2019 · 3 comments
Closed

Java Path Spaces Error for Java Maven Project #647

JoelProminic opened this issue Dec 30, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@JoelProminic
Copy link
Contributor

I found another case where SDK spaces are not handled properly in Windows Moonshine (2.5.0, and the latest nightly build). I already had Java installed on this Windows machine, so Moonshine used the path from the environment variable:

C:\Program Files\Java\jdk1.8.0_161
  1. Create a new Java Maven Project

  2. Wait for the Language server to finish starting. Note that this works fine

  3. Project > Build. BUG: this fails with the error:

    : Starting Maven build...
    : Maven path: C:\MoonshineSDKs\Maven\apache-maven-3.6.0
    : Maven build directory: C:\Flex\temp_workspace\TestJavaMavenSpaces
    : Command: C:\MoonshineSDKs\Maven\apache-maven-3.6.0\bin\mvn.cmd clean package
    : Files\Java\jdk1.8.0_161""=="" was unexpected at this time.
    : Maven build has been terminated with exit code: 255

From the error, it looks to me like the space is not escaped properly.

On a side note, I tried to work around this by clearing JAVA_HOME and using Moonshine SDK Installer to download Java to the default path (with no spaces). However, Moonshine still repopulated the above Java path.

@JoelProminic JoelProminic added this to the v2.6.0 milestone Dec 30, 2019
@JoelProminic JoelProminic modified the milestones: v2.6.0, v2.5.1 Jan 22, 2020
@piotrzarzycki21
Copy link
Collaborator

I have finally nailed it down! It looks like on Windows when we setup JAVA_HOME with quotes it causes an error when Maven is using it. This causes issue:

set JAVA_HOME="C:\Program Files\Java\jdk8u202-b08"
without
set JAVA_HOME=C:\Program Files\Java\jdk8u202-b08

Everything is working fine. I'm going to commit my changes so please if you will have any problems with something related to Java on Windows let me know.

@piotrzarzycki21 piotrzarzycki21 added this to Done #2.3.0 in Moonshine-IDE - Bug Fixing via automation Jan 27, 2020
@piotrzarzycki21
Copy link
Collaborator

@rat-moonshine Be careful with my changes - if anything will be broken related to Java - let me know. I will test also Java project once nightly build will be ready.

@piotrzarzycki21
Copy link
Collaborator

It looks like Java Maven project is working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants