如何解决映射到非Java文件类型文本的Java文件 [英] How to solve java file mapped to not java file type text

查看:69
本文介绍了如何解决映射到非Java文件类型文本的Java文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Java类添加到项目中,但是我犯了一个错误,并将其添加为文本文件.然后,我删除了它,并尝试再次将其添加为java类,但是不幸的是它不再起作用了.我收到以下错误:

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

在搜索时,我遇到了一些解决方案,例如这个但找不到 Editor 下的 File Type 或我可以根据解决方案中的建议进行更改的任何类似内容.

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.

任何帮助将不胜感激.

PS:我正在使用IntelliJ 2018.3.4.

PS: I am using IntelliJ 2018.3.4.

预先感谢

推荐答案

继续进行 File-> Settings ,将打开一个对话框.在该对话框的左侧导航到 Editor/File Types ,然后您需要从 Recognized File Types Java Class 部分中选择并删除从底部开始,出现问题的扩展程序(请注意,您在右侧有一个小的减号按钮)

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

这篇关于如何解决映射到非Java文件类型文本的Java文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆