Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Handle _JAVA_OPTIONS env var (used to address a Java heap error) #228

Merged
merged 3 commits into from
May 12, 2017

Conversation

jeffyoung
Copy link
Contributor

For whatever reason, some times the CLC can fail to initialize the Java VM (I've seen this on Windows; and I do have a 64-bit JRE installed). When it fails, nothing happens in the VS Code UI (no error message, no TFVC initialization). After turning on logging, you see this:

image

The TFVC errors line is blank (because we only log stderr, in this case where add returns 1, stderr is blank but stdout has the error message).

When you try to run the command in a command prompt, you get the following:

image

That's what is causing the failure. After digging, you have to set the _JAVA_OPTIONS env var (either user or a system variable):
image

The CLC then outputs the following to stdout (see the 'Picked up _JAVA_OPTIONS' line):
image

(But notice that it actually runs.)

This PR is to handle the issue and ensure we display an error in the UI, like this:

image

The error that comes back is added to the end of the displayed message (to give us some kind of hope on debugging). The same message is displayed on hover in the status bar 'Team '.

Jeff Young added 3 commits May 12, 2017 14:25
This removes FormatMessage from having a dependency on 'vscode' (which VsCodeUtils does).  Having a dependency on 'vscode' immediately fails unit tests.
Copy link
Member

@jpricket jpricket left a comment

Choose a reason for hiding this comment

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

Too bad we have to do this

@jeffyoung jeffyoung merged commit f329d0c into master May 12, 2017
@jeffyoung jeffyoung deleted the jeyou/fix-java-heap-error branch May 12, 2017 20:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants