6

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..

enter image description here

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...

enter image description here

AAny suggestions..

Update:

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

enter image description here

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

enter image description here

8
  • DId you remove java via the p2 plugin manager? Commented Aug 1, 2013 at 2:56
  • @hexafraction Not sure..I don't remember any thing like that..but how can i verify? Commented Aug 1, 2013 at 2:58
  • Check the help menu's software installation/uninstallatin options and make sure Java is still installed. Commented Aug 1, 2013 at 2:59
  • @hexafraction java plugin is not installed but when i try to install it says latest version already installed..Updated the original question with screenshots Commented Aug 1, 2013 at 3:42
  • Did you change which JRE you use to launch Eclipse? Commented Aug 1, 2013 at 3:47

5 Answers 5

2

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

(I actually closed all the tabs...)

Sign up to request clarification or add additional context in comments.

Comments

1

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

Preferences Window

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.

Comments

0

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

Comments

0

TLDR; open another workspace, then come back to the original workspace.

Ok this is odd, but for me, all the highlighting suddenly went away for Java files. I explored all of these ideas here, with no effect. I created a new workspace, planning to move everything to it. I realized that can be a pain to move many projects over, so I went back into the original workspace to look at some settings, and poof - the highlighting was working again.

Comments

0

I have one java class file like a text editor.

I tried following,

  1. Select the respective java class file from eclipse.
  2. Right click on the file and mouse hover on "Open with".
  3. Select java editor.

Now its works.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.