How do I create a compile and run a project imported from git?
Hi there,
This may be a very basic question but I was hoping someone could help me out. When I create a project through IntelliJ, I have no issues with compiling and running the program. My issue is when I add a project that already existed. For example, I cloned my sample GitHub project onto my computer. I then opened the project using IntelliJ for the first time. I have no issue compiling and running the program using a terminal but was unsure how to do it using the IDE's built in tools. I do go into Run > Edit Configurations to create an application to compile and run. It makes my life easier when I can click run and it compiles and runs the program. I have attached a screenshot of where I am stuck at. Thank you very much.
Please sign in to leave a comment.
The project structure looks incorrect: you need to place the source code under the folder marked as a source root, see Configure folder categories. Then you can run it (e.g. from Editor, see Running a class with main() method).
>I then opened the project using IntelliJ for the first time.
For IDE to automatically configure the project layout so to avoid such issues, open the project via importing from existing sources action: Import a project.