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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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:
That's what is causing the failure. After digging, you have to set the _JAVA_OPTIONS env var (either user or a system variable):
The CLC then outputs the following to stdout (see the 'Picked up _JAVA_OPTIONS' line):
(But notice that it actually runs.)
This PR is to handle the issue and ensure we display an error in the UI, like this:
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 '.