JUnit4 + Eclipse “An internal error occurred during Launching”

后端 未结 10 1588
深忆病人
深忆病人 2020-12-09 16:37

I\'m trying to run JUnit4 test cases on Eclipse 3.4.2 but it\'s not even starting for me. I have the junit-4.7.jar in my build path and the test application.

Here i

相关标签:
10条回答
  • 2020-12-09 17:17

    I was able to fix this just by deleting the workspace and the Eclipse directory and starting over.

    0 讨论(0)
  • 2020-12-09 17:18

    None of the given answers here worked for me, so I ended up just installing and using InfiniTest instead. It doesn't have this problem, and it also runs the tests automatically so I can focus on my work.

    Eclipse with Infinitest showing a red "tests failed" status message and the corresponding assertion error in the "Problems" tab

    0 讨论(0)
  • 2020-12-09 17:18

    This error In eclipse can be caused if you are also using the Android Development Kit plugins:

    "Launching UTest' has encountered a problem
        An internal error occurred during: "Launching UTest".
        java.lang.NullPointerException
    

    Can be caused if you are loading a normal Java project into an Eclipse instance with android ADT plugins installed and enabled. In this situation, Eclipse looks for "Android" project files, and doesn't find any. So it says: "NullPointerException".

    So to fix it, re-download Eclipse without the ADT Plugin: https://www.eclipse.org/downloads/

    Then re-import your project fresh. And the junit tests run without a problem.

    Many people hate eclipse for it's enigmatic error messages. It's like we are back in the 1950's punch card world, where there are no error messages. The program just halts and undefined behavior occurs.

    0 讨论(0)
  • 2020-12-09 17:22

    What worked for me after trying everything:

    1. Go to help
    2. Install New Software
    3. Work with: Juno
    4. Programming languages (expand it)
    5. Install Java Development Tools
    6. Restart

    It works :)

    0 讨论(0)
  • 2020-12-09 17:25

    This worked for me:

    1. create another copy of the test class (CopyOfUTest.java)
    2. run the copy to make sure it passes
    3. go into Run > Run Configurations
    4. under JUnit, find the run configurations for the original class and the copied class
    5. right click and delete the configuration of the original class
    6. rename the configuration of the copied class to the original configuration name
    7. delete the copied class from the project
    0 讨论(0)
  • 2020-12-09 17:28

    Thanks that solved my problem too. The problem started when i removed an old simulator, and created a new one. Fix: Like the OP says remove the workspace, make sure to keep the projects inside it :) then import them back to eclipse "Sound like a lot of work" ? Took me less than half a minute !!!

    0 讨论(0)
提交回复
热议问题