简体   繁体   English

git clone在Java中不起作用

[英]git clone does not work in java

I am using jgit to clone a repository of using java code. 我正在使用jgit克隆使用Java代码的存储库。 I am able to clone to a local (windows) machine when testing, but unable to clone to a aws server. 测试时,我可以克隆到本地(Windows)计算机,但是无法克隆到AWS服务器。

Folder is not created in local path. 不在本地路径中创建文件夹。 I am creating the clone under /tmp/loc/$proName . 我正在/tmp/loc/$proName下创建克隆。 I gave 777 to the loc folder, but not able to get a repo inside that. 我将777分配给loc文件夹,但无法在其中获取存储库。

Any help would be appreciated. 任何帮助,将不胜感激。

Thanks in advance 提前致谢

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.util.FS

THat seems to be a pending bug for which it was suggested: 有人建议将其视为一个待解决的错误

this is probably incomplete classpath in the script. 这可能是脚本中不完整的类路径。

Please try editing your /usr/bin/jgit script and changing the " export JGIT_CLASSPATH " line to the following: 请尝试编辑/usr/bin/jgit脚本,并将“ export JGIT_CLASSPATH ”行更改为以下内容:

export JGIT_CLASSPATH="$(build-classpath jgit slf4j args4j jsch commons-compress xz-java javaewah)"

And see if that fixes the problem for you. 看看是否能为您解决问题。

In short - complete reinstall of Eclipse fixed the java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.util.FS error I was getting. 简而言之-完全重新安装Eclipse修复了java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.util.FS我收到的java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.util.FS错误。

I'm on a mac, and I tried updating Eclipse and Java with a reboot as well and the problem persisted. 我在Mac上,我也尝试通过重新启动来更新Eclipse和Java,但问题仍然存在。

I just decided to reinstall Eclipse and that solved the problem. 我只是决定重新安装Eclipse,从而解决了该问题。 I moved my entire /Applications/Eclipse.app folder to a temp location, then downloaded and ran Eclipse again and it works fine, git integration is fine too ;-) 我将整个/Applications/Eclipse.app文件夹移到一个临时位置,然后下载并再次运行Eclipse,它运行良好,git集成也很好;-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM