[英]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.