3

enter image description hereava

I've deleted and redone this a bunch of times and I can't create a simple class. If I set the src folder the root folder and run the Test.java it works, however it doesn't show the blue "C" icon and shows that rectangular "J" Icon for Test.java

How do I fix this?

JustForLong
  • 109
  • 8
  • Check your [class](https://i.imgur.com/ekd9HvV.png) and [header templates](https://i.imgur.com/XsxG0bY.png). It looks like invalid code gets generated. Restore the templates to the defaults. – CrazyCoder Feb 25 '20 at 21:51
  • Just tried it, it seemed like nothing happened – JustForLong Feb 25 '20 at 22:03
  • Please share the screenshots with these templates, the `Test.java` file contents and the exception from [idea.log](https://intellij-support.jetbrains.com/hc/articles/207241085). – CrazyCoder Feb 25 '20 at 22:04
  • Okay I uploaded the photo, I don't understand the idea.log file. I've found where it's located, should I send you screenshots of all the exceptions? – JustForLong Feb 25 '20 at 22:12
  • Upload the log somewhere, like https://pastebin.com/ and share a link. Did you try changing the project roots as suggested in my answer? You also didn't provide the file template for the java class and the code template for the include as shown on my comment screenshots. – CrazyCoder Feb 25 '20 at 22:13
  • Okay strangest thing happened, I just had my computer restarted and everything works just normal now. I have no idea why? – JustForLong Feb 26 '20 at 01:13

1 Answers1

0

The source roots are not configured correctly. Only src directory needs to be configured as the source root, not the root directory of your project.

See the related questions:

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904