简体   繁体   English

将 Java 项目克隆到 IntelliJ ,现在我看不到任何源文件

[英]Cloned a Java project to IntelliJ , now I can't see any source files

So me and a friend decied to try out IntelliJ for our next project instead of Eclipse but we are having some issues.所以我和一个朋友决定在我们的下一个项目中尝试使用 IntelliJ 而不是 Eclipse,但我们遇到了一些问题。

At first I created the project on my computer(lets call i com1) in eclipse, created repo on github and pushed it.起初我在我的电脑上在 eclipse 中创建了这个项目(我们称之为 com1),在 github 上创建了 repo 并推送了它。 This worked just fine.这工作得很好。 On my com2 I cloned the repo to eclipse and continued working, no issues whatsoever.在我的 com2 上,我将 repo 克隆到 eclipse 并继续工作,没有任何问题。

Then I installed IntelliJ and just imported the project that was already on com1.然后我安装了 IntelliJ 并导入了已经在 com1 上的项目。 This worked fine aswell.这也很好用。 Then on com2, I cloned the repo from github and the problems started to arise.然后在com2上,我从github克隆了repo,问题开始出现。 IntelliJ failed to find my main class and my main method. IntelliJ 未能找到我的主要类和主要方法。 After 3 hours of searching I just couldn't get it to work.经过 3 个小时的搜索,我无法让它工作。 I removed the repo, the project and all on both machines.我删除了两台机器上的 repo、项目和所有内容。 Created a new repo and made a new project, copied over my src files and pushed it to the new repo on com2.创建了一个新仓库并创建了一个新项目,复制了我的 src 文件并将其推送到 com2 上的新仓库。 Now that works fine, then I started com1 and cloned the repo, and now all I can se in the project explorer is the .gitignore file and the External Libaries folder.现在工作正常,然后我启动了 com1 并克隆了 repo,现在我可以在项目资源管理器中看到 .gitignore 文件和 External Libaries 文件夹。

What am I doing wrong here?我在这里做错了什么? I just want to code but using git and github takes so much time for me.我只想编码,但使用 git 和 github 对我来说需要很多时间。

I had the same problem some time ago.前段时间我遇到了同样的问题。 The solution was to create a module inside IntelliJ (File->New Module).解决方案是在 IntelliJ 中创建一个模块(文件->新模块)。 Try if it helps.试试看是否有帮助。 Stack solution link. 堆栈解决方案链接。

Do you use maven or gradle?你使用maven还是gradle? You can import the maven/gradle project instead of importing just source code and folders.您可以导入 maven/gradle 项目,而不仅仅是导入源代码和文件夹。

Using such tools can help you to abstract from any IDE.使用此类工具可以帮助您从任何 IDE 中进行抽象。

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

相关问题 在Intellij中移动了项目,现在我无法编译 - Moved project in Intellij and now I can't compile 我可以看到IntelliJ用于构建java项目的确切命令吗? - Can I see the exact commands IntelliJ uses to build a java project? 在intellij idea 12中,是否有任何设置可以过滤掉我不想在项目视图中列出的文件? - In intellij idea 12, is there any settings can filter out files that I don't want to list in project view? 无法在 IntelliJ 中编译/运行 java 项目 - Can't compile/run a java project in IntelliJ Intellij:Javadoc 在 ctrl+b 后我看不到方法的描述,class 在 java 文档中 - Intellij: Javadoc I can't see description of the methods, class in java documentation after ctrl+b 无法解决IntelliJ上与项目语言级别有关的源错误 - Can't resolve -source errors on IntelliJ with regards to Project Language Level Java MVC项目 - 我无法更新绘图,或者我看不到它 - Java MVC project - either I can't update the drawing, or I can't see it 为什么我在这个 Java 动态 web 项目中没有看到任何 main 方法? - Why don't I see any main method in this Java dynamic web project? Intellij Idea无法找到其他来源的课程文件 - Intellij Idea can't find class files from other source IDEA——导入maven工程后,看不到源码 - IDEA - after importing maven project, can't see source code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM