【问题标题】:git-tf clone exception java.lang.UnsatisfiedLinkErrorgit-tf 克隆异常 java.lang.UnsatisfiedLinkError
【发布时间】:2020-12-18 20:52:17
【问题描述】:

我正在尝试使用 git-tf 在 TFS 上克隆 TFVC 项目。当我运行 git-tf clone 时,系统提示我输入我的 TFS 用户名,输入我的用户名后,我得到一个 java.lang.UnsatisfiedLinkError。 我的目标是将此项目迁移到 Git 并将其推送到 Gitlab,同时保留变更集历史记录。

命令: git-tf 克隆 https://tfs-url/tfs/defaultcollection/ $/TFSProjectName ~/Desktop/MyTFSProject --deep

完全例外:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 'boolean com.microsoft.tfs.jni.internal.console.NativeConsole.nativeEnableEcho()'
    at com.microsoft.tfs.jni.internal.console.NativeConsole.nativeEnableEcho(Native Method)
    at com.microsoft.tfs.jni.internal.console.NativeConsole.enableEcho(NativeConsole.java:56)
    at com.microsoft.tfs.jni.ConsoleUtils.enableEcho(ConsoleUtils.java:47)
    at com.microsoft.gittf.client.clc.commands.framework.Command.prompt(Command.java:510)
    at com.microsoft.gittf.client.clc.commands.framework.Command.promptForPassword(Command.java:482)
    at com.microsoft.gittf.client.clc.commands.framework.Command.promptForCredentials(Command.java:470)
    at com.microsoft.gittf.client.clc.commands.framework.Command.getDefaultCredentials(Command.java:309)
    at com.microsoft.gittf.client.clc.commands.framework.Command.getCredentials(Command.java:335)
    at com.microsoft.gittf.client.clc.commands.framework.Command.getConnection(Command.java:370)
    at com.microsoft.gittf.client.clc.commands.CloneCommand.run(CloneCommand.java:203)
    at com.microsoft.gittf.client.clc.Main.main(Main.java:328)

环境:

  • 操作系统:MacOS Catalina 10.15.5
  • Java:openjdk 11.0.7 2020-04-14
  • Git-tf:git-tf 版本 2.0.3.20131219

【问题讨论】:

    标签: git tfs git-tf


    【解决方案1】:

    从报错信息来看,这个问题的原因是java版本。

    查看有关Git-TF 的文档。您可以下载 Java 7 并将其设置为 PATH 环境变量

    用 Java 8 测试,它也可以工作。

    另一方面,Git-TF 已经到了生命的尽头。

    我的目标是将这个项目迁移到 Git 并将其推送到 Gitlab,同时 当然是维护变更集历史记录。

    我推荐你使用Git-tfs来实现它。

    这是脚本:

    git tfs clone <TFS URL> $/project
    
    cd repo path
    
    git checkout -b TempBranch 
    
    git remote add origin <Git URL>
    
    git push --set-upstream origin TempBranch
    

    在这种情况下,TFVC 存储库可以更改为 Git 存储库。然后你可以使用 git push 将 Repo 推送到 Gitlab。

    它也会保留历史记录。

    【讨论】:

    • 非常感谢!但据我所知,Git-tfs 不适用于 MacOS (github.com/git-tfs/git-tfs/issues/758),这就是我选择 git-tf 的原因。
    • 我尝试安装 java 7 并将其添加到 $PATH 并使用 /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/ 设置 $JAVA_HOME 但仍然发生同样的错误。
    • 感谢您的信息。安装Java后,您是否尝试过重新启动机器?如果这个问题仍然存在,请您尝试其他 git-tf 命令(git-tf configure)?您可以检查其他命令是否有相同的问题。
    猜你喜欢
    • 2020-03-02
    • 1970-01-01
    • 2020-10-28
    • 2016-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-23
    • 1970-01-01
    相关资源
    最近更新 更多