How to solve java file mapped to not java file type text
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
Select required file type in top list (Recognized File Types) -- do it for "Text files" In bottom list (Registered Patterns) select undesired pattern -- "SomeFileName.java" Click on "-" (Minus) button to remove pattern from the list Repeat 1-2-3 for other undesired patterns
If desired, you can also do this manually by editing config file while IDE is closed. Because it's IDE-wide setting, it is not stored in .idea folder (which has project settinsg only) -- the file to look for is called filetypes.xml and shoudl be located in ~/Library/Preferences/IntelliJIdeaXX/options ( see http://devnet.jetbrains.net/docs/DOC-181 for other OS etc )