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


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

                
             up vote7down votefavorite
    1

    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()    
    
    share|improve this question
     
       

    3 Answers                                 3

             up vote22down voteaccepted

    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.

    share|improve this answer
     
                                                                                                                        
    I doubt a breakpoint would lead to this error. Are you sure it's not a coincidence ? Any detail ?                     – Denys Séguret                 Aug 14 '14 at 19:02                                                                                                 
                                                                                                                        
    I added a breakpoint to the js file, but it did not recreate the issue. I left it for a couple days and still nothing happened. So, I'm not sure what triggers the issue. I highly doubt I had put a breakpoint in there originally. It seemed that eclipse just got in an bad state. Restarting eclipse didn't help, only removing this odd breakpoint at the start of the file.                     – Noremac                 Aug 18 '14 at 13:51                                                                            
                                                                                                                        
    Of course, after posting the above, I started getting the error again and apparently on the breakpoint I set a few days ago (except now the breakpoint is at the top of the file, just like the other one was). Is there anything you'd like me to try while I am getting the issue?                     – Noremac                 Aug 18 '14 at 20:37                                                                                                 
                                                                                                                        
    There are so many cases of one of the many Eclipse caches getting corrupted that it's probably impossible to determine which Eclipse bug you encountered. In my opinion you should probably delete this QA as hopeless.                     – Denys Séguret                 Aug 19 '14 at 6:41                                                                            
                                                                                                                        
    It's meant for as an answer, how to fix this issue. I wasn't expecting a full explanation, or as a bug report. This fixed it for me, and I only found it through an obscure comment. Putting it as QA makes the fix much more readily available.                     – Noremac                 Aug 19 '14 at 14:16                                                                            
                
             up vote3down vote

    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.

    share|improve this answer
     
       
             up vote0down vote

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

    share|improve this answer
     
       
                                                             

     

     
  • 相关阅读:
    【CF1523E】Crypto Lights
    【洛谷P3228】数列
    【洛谷P4319】变化的道路
    Educational Codeforces Round 110
    【洛谷P2444】病毒
    一、Java语言基础(1)_走进java——第一个java程序
    android studio 调试smali
    Kickstart Round B 2018
    Proj THUDBFuzz Paper Reading: A Review of Machine Learning Applications in Fuzzing
    Proj THUDBFuzz Paper Reading: Fuzzing: Hack, Art, and Science
  • 原文地址:https://www.cnblogs.com/xuxiuxiu/p/5811069.html
Copyright © 2020-2023  润新知