How to solve java file mapped to not java file type text

user1419243 :

I wanted to add a java class to a project, but I did a mistake and added it as a text file. Then, I removed it and tried to add it again as a java class, but unfortunately it doesn't work anymore. And I get the following error:

Unable to parse template "Class" Error message: ABC.java mapped to not java file type text

As I searched, I faced some solutions like this one but I can't find File Type under Editor or anything similar that I can change as suggested in the solution.

Any help would be appreciated.

PS: I am using IntelliJ 2018.3.4.

Thanks in advance,

Borislav Markov :

Go on File->Settings and a dialog will open. In that dialog navigate on the left part to Editor/File Types and then you need to choose from the section Recognized File Types Java Class and remove from bottom section the problematic extension (note you have a small minus button on the right)

https://www.jetbrains.com/help/idea/creating-and-registering-file-types.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=157111&siteId=1