How can I fix "Compilation unit name must end with .java, or one of the registered Java-like extensions"?

I had an errant breakpoint set in the file. Removing the breakpoint resolved the problem.

The answer comes from a comment in another post, but was a bit obscure in the comments of a lower ranked answer here: JavaScript editor within Eclipse

Hopefully putting it here will make it easier to find as I didn't find much when I was trying to resolve this before.


I also fixed this by removing breakpoints. The interesting thing was, I wasn't able to remove the breakpoint by double clicking on it as you normally would.

I had to go into the Breakpoint View and right click and remove the breakpoint from this file. Directly afterwards, I tried to save again, and it was the first time the task completed.


I came here for help and it was indeed due to a breakpoint in a javascript .js file (JSDT related bug ?). I had the error popup each time I saved in the .js file.

Go to:

Eclipse Debug perspective -> Breakpoints

view and remove the breakpoint from the .js file.

Fixed: You can now save the .js file without the error.

Tags:

Eclipse