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

Fix issues with long java classpath on Windows platform #102

Merged
merged 2 commits into from
Jul 18, 2017
Merged

Fix issues with long java classpath on Windows platform #102

merged 2 commits into from
Jul 18, 2017

Conversation

mdolinin
Copy link
Contributor

@mdolinin mdolinin commented Jul 17, 2017

Windows platform has limitation on Maximum Path Length (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx)
This cause problem with starting Gauge execution in java projects with long classpath
To fix this issue we can set the CLASSPATH as an environment variable

This fix will resolve:
getgauge/gauge#156
getgauge/gauge#184
getgauge/Intellij-Plugin#277
getgauge/Intellij-Plugin#164
getgauge/Intellij-Plugin#277

@mdolinin
Copy link
Contributor Author

@BugDiver @sriv @kashishm guys, can somebody help me to fix CI builds?

gauge-java.go Outdated
cmd := exec.Command(cmdName, args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
env := os.Environ()
env = append(env, fmt.Sprintf("CLASSPATH=%s", classpath))
cmd.Env = env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdolinin If the CLASSPATH env already exists then it should overwrite it but currently it will append multiple CLASSPATH to environment. You can use os.Setenv to add CLASSPATH env and exec.Command will inherit that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for help. Fixed in next commit.

@BugDiver BugDiver merged commit 14c3e9b into getgauge:master Jul 18, 2017
@BugDiver
Copy link
Member

BugDiver commented Jul 18, 2017

@mdolinin Thanks for your contribution.
I just wanted to highlight that there is a CLA for Gauge which I forgot to mention. Could you please sign it ?

@mdolinin
Copy link
Contributor Author

@BugDiver Sure. Signed. Thanks for help.

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

Successfully merging this pull request may close these issues.

2 participants