EGit - 从github导入项目(仅src)作为java项目

时间:2015-12-19 20:01:02

标签: java eclipse github project

我最近尝试了导入项目,它只有src(* .java)文件。我总是收到像

这样的错误
Connecting Git team provider failed. See log for details.
Connecting Git team provider failed. See log for details.
Error connecting project Navigator, no Git repositories found

.gitignore看起来像这样:

/bin/
# Intellij
.idea/
*.iml
*.iws

# Eclipse
.classpath
.project
.settings/

# Package Files #
*.jar
*.war
*.ear

*.class

我可以导入项目(作为裸src文件 - 不能执行它而不支持java名称等)但是当我尝试将其转换为java项目时,我会在问题开头收到类似的错误

@ EDIT1 正如问.log:

!SESSION 2015-12-19 22:37:01.406 -----------------------------------------------
eclipse.buildId=4.5.1.M20150904-0015
java.version=1.8.0_65
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pl_PL
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY org.eclipse.egit.ui 2 0 2015-12-19 22:37:11.004
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Jakub'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.egit.ui 4 0 2015-12-19 22:38:31.914
!MESSAGE Connecting Git team provider failed. See log for details.
!STACK 1
org.eclipse.core.runtime.CoreException: Connecting Git team provider failed. See log for details.
    at org.eclipse.egit.core.op.ConnectProviderOperation.execute(ConnectProviderOperation.java:111)
    at org.eclipse.egit.ui.internal.clone.GitImportWizard$8.run(GitImportWizard.java:286)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2241)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2225)
    at org.eclipse.egit.ui.internal.clone.GitImportWizard.importProjects(GitImportWizard.java:291)
    at org.eclipse.egit.ui.internal.clone.GitImportWizard.access$2(GitImportWizard.java:235)
    at org.eclipse.egit.ui.internal.clone.GitImportWizard$4.run(GitImportWizard.java:205)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Contains: Error connecting project Navigator, no Git repositories found
!SUBENTRY 1 org.eclipse.egit.core 4 0 2015-12-19 22:38:31.916
!MESSAGE Connecting Git team provider failed. See log for details.
!SUBENTRY 2 org.eclipse.egit.core 4 0 2015-12-19 22:38:31.916
!MESSAGE Error connecting project Navigator, no Git repositories found

1 个答案:

答案 0 :(得分:0)

我在eclipse中导入自己的PHP项目时遇到了类似的问题。我不知道如何修复它,但是当导入而不是为我工作的java项目时,将项目更改为一般的eclipse项目。然后,如果需要,可以将常规eclipse项目更改为java项目。