No syntax highlighting in eclipse for java

心已入冬 提交于 2019-12-23 09:36:55

问题


There is no syntax highlighting in java files in my eclipse..This happened all of a sudden..Not sure why..

This is how it is looking now..

As mentioned in other posts..i tried to change the color from preferences window and there is nothing when i type java..something really messed up...

AAny suggestions..

Update:

It seems Java plugin is not installed..as per the below screeenshot

And when i try to install java plugin it says new version is already installed as per the below screenshot


回答1:


Closing the file's tab and re-opening it fixed it for me.

(I actually closed all the tabs...)




回答2:


I faced the same issue all of a sudden after a commit/update project operation.

The point is, default editor of Eclipse has changed somehow and we have to set it back to normal.

Try the below method,
1. Goto Windows -> Click Preferences
2. From the Preferences window goto General -> Editors -> Click File Associations
3. You can choose the default editor for *.java files here

When I first opened Preferences, 'Text editor' was set as the default editor for .java files and then I changed it back to 'Java Editor'.

Now it works perfectly fine.




回答3:


You probably have a corrupt installation or you have recently installed a corrupt plugin.

The following steps might help.

In your Install window,

  1. view your "already installed" plugins.
  2. select the "Installation History" tab.
  3. select a previous stable configuration
  4. Click the "Revert" button


来源:https://stackoverflow.com/questions/17984485/no-syntax-highlighting-in-eclipse-for-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!