nus-cs2103-AY2425S1 / forum

12 stars 0 forks source link

Code does not run after deleting .idea file in ip folder #120

Closed FlyingDonkeys closed 4 weeks ago

FlyingDonkeys commented 4 weeks ago

I was trying to get Gradle to work but am currently facing issues after deleting the .idea file. Was tinkering with the commands given in the 2103T website tutorial but cant seem to get it to work. Also accidentally invalidated caches in an attempt to fix the errors but inadvertently deleted my local history so I cannot rollback to a previous local version... Code cannot be compiled anymore and doing git pull on my previous work does not seem to make the code runnable. Any suggestions?

damithc commented 4 weeks ago

@FlyingDonkeys While waiting for others to help, can you post a screenshot of your current project folder contents? How did you try to run the gradle commands (can you post a screenshot of that too)?

yadobler commented 4 weeks ago

What's the "error" happening? Is it incorrect jdk? Jdk not found? Something like unable to open cp_proj? Or unable to find main / entry point?

Also do tell which os you're using cos for example Linux / nixos has been a pain to resolve.

itsme-zeix commented 4 weeks ago

@FlyingDonkeys Have you tried reimporting the project? That should help to re-create the .idea folder (I think?)

Could you also share what steps you've already tried? It will make it easier to know what has or has not been tried yet.

If nothing else works, you could always clone the repository in a new directory with git clone and import it into IntelliJ.

FlyingDonkeys commented 4 weeks ago

Screenshot 2024-08-30 100116

@damithc this is my current folder contents. My chatbot "Bonnie" cannot be run now after I tried getting gradle to work. I have in fact done git clone the repo into a new directory and this is what it looks like from my latest workable code. Any advice guys?

damithc commented 4 weeks ago

@FlyingDonkeys Did you do step 1? image

EDIT: Never mind. I realized you are now trying it without Gradle.

Incogdino commented 4 weeks ago

My chatbot "Bonnie" cannot be run now after I tried getting gradle to work.

I found this answer on stackoverflow regarding this question.

https://stackoverflow.com/a/56377111/16322247

FlyingDonkeys commented 4 weeks ago

I have resolved the issue after marking ip my sources root in Intellij. Thanks a ton @Incogdino!

damithc commented 4 weeks ago

I have resolved the issue after marking ip my sources root in Intellij. Thanks a ton @Incogdino!

@FlyingDonkeys You are strongly recommended to use src/main/java as the source root. That's what Gradle expects. src, main, and java should not be used as packages.