Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

eclipse

This error comes up in an alert box when I try saving my js file in eclipse:

Compilation unit name must end with .java, or one of the registered Java-like extensions

In the breakpoints view I see this:

/module-foo/src/main/resources/frontend/foo/foo_base.js [entry] - ___anonymous()    
like image 433
Noremac Avatar asked Aug 14 '14 19:08

Noremac


2 Answers

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.

like image 192
Noremac Avatar answered Oct 19 '22 15:10

Noremac


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.

like image 38
ivandov Avatar answered Oct 19 '22 15:10

ivandov