16

I have installed and configured git-credential-manager on Mac OSX according to these instructions:

https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux/blob/master/Install.md

The brew install complained about a missing Java requirement and suggested a command to install Java, which I did.

After completing everything, I now get the following error when trying to perform a git clone from a private repository:

Cloning into 'Weather'...
Fatal: java.lang.IllegalArgumentException encountered.  Details:
Unrecognized version string '9+181'.
fatal: credential helper '!/Library/Java/JavaVirtualMachines/jdk-
9.jdk/Contents/Home/bin/java -Ddebug=false -Djava.net.useSystemProxies=true 
-jar /usr/local/Cellar/git-credential-manager/2.0.3/libexec/git-credential-
manager-2.0.3.jar' told us to quit

Does anyone know how to fix?

2 Answers 2

16

Oct. 2017: That is tracked with Microsoft/Git-Credential-Manager-for-Mac-and-Linux issues/69

I dumped Java 9 and installed Java 8, and everything worked just fine.

brew cask remove java    

Reinstall git-credential-manager

git-credential-manager install

I stumbled on the same issue as @JoeyHerrington and installed JDK8 instead:

brew cask install caskroom/versions/java8

Update Sept. 2018: the same issue now includes:

version 2.0.4 of Git Credential Manager now supports Java 9+.
The update is available on GitHub and will be available on Homebrew soon.

So the OP (one year later) should not be an problem anymore.


Thomas Hagström adds in the comments:

I would say removing the folders is safest.

sudo rm -rf "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" 
sudo rm -rf "/Library/PreferencePanes/JavaControlPanel.prefPane" 
sudo rm -rf "~/Library/Application Support/Oracle" 
sudo rm -rf "~/Library/Java"

Then reinstall git credential manager so it picks up the correct Java version / virtual machine.

Sign up to request clarification or add additional context in comments.

8 Comments

I uninstalled Java 9 and installed Java , but when I run git clone, I now get: Olavs-MacBook-Pro:Repos olavt$ git clone olavt.visualstudio.com/_git/Weather Cloning into 'Weather'... /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/java -Ddebug=false -Djava.net.useSystemProxies=true -jar /usr/local/Cellar/git-credential-manager/2.0.3/libexec/git-credential-manager-2.0.3.jar get: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/java: No such file or directory
@OlavT Could you try and uninstall/reinstall the credential manager?
I tried it on another Mac and it works fine if you install Java 8.
@ThomasHagström Thank you. I have included your comment in the answer for more visibility.
I did only the git-credential-manager install and it works as usual. It broke after brew upgrade on macos
|
3

I had the same issue after I inserted some wrong credentials requested by git while using IntelliJ. I solved it by changing the helper in ~/.gitconfig, (like @Migg said :). My gitconfig was pointed to the Java 8, and how I had already installed Java 8 and Java 11 installed in my machine (OSX 10.14). I just pointed to the newest version.

Before

[user]
    email = <email>
    name = <name>
[core]
    autocrlf = input
[credential]
    helper = !/Library/Java/JavaVirtualMachines/<java-1.8>/Contents/Home/jre/bin/java -Ddebug=false -Djava.net.useSystemProxies=true -jar /usr/local/Cellar/git-credential-manager/2.0.4/libexec/git-credential-manager-2.0.4.jar

After

credential]
        helper = !/Library/Java/JavaVirtualMachines/jdk-11.0.3.jdk/Contents/Home/jre/bin/java -Ddebug=false -Djava.net.useSystemProxies=true -jar /usr/local/Cellar/git-credential-manager/2.0.4/libexec/git-credential-manager-2.0.4.jar

2 Comments

Thanks, this was helpful. One small addition: the path mentioned does not seem to be completely correct, I changed it to: /Library/Java/JavaVirtualMachines/jdk-11.0.3.jdk/Contents/Home/bin/java (so without the jre) and then it works for me.
Thanks, this helped me. Fixed it by removing the credential setting altogether.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.