idea does not recognize a class with a certain name

Error description : The controller layer of the spring mvc framework reports this error when creating the UserController class, but it can create a CardController. As long as the name UserController will not work.

After a day of pitting, I finally found the reason : I accidentally entered the wrong suffix name when I first built the class, (probably CardController.java.text)

Then it was recorded by the idea, and then as long as the file of CardController.java was browsed in the text format by default.

Solution: As shown in the figure, just delete CardController.java in the test and click OK, it is really OK

 

I tried two ways before, but to no avail (if all classes are not recognized, you can try)

  1. Method 1: Find the idea.exe.vmoptions and idea.exe.vmoptions files under the bin of idea plus -Djdk.util.zip.ensureTrailingSlash=false
  2. Method 2: Set the templates of the class

    

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
public class ${NAME} {
}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325566730&siteId=291194637
Recommended