0

I have a workspace that builds the open source jedit editor, that worked fine in NetBeans 8.0, and I upgraded to NetBeans 8.1, and it imported my IDE settings. When I build my project it has this new error:

Error: Could not find or load main class org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner
...
C:\..\jedit-svn\build.xml:453: Unit test(s) failed! See reports at C:\Users\warren\IdeaProjects\jedit-svn\build/test/reports/index.html
BUILD FAILED (total time: 15 seconds)

I have junit-4.12.jar and hamcrest-core-1.3.jar referenced in my project classpath/jar-list. The jUnit plugin for NetBeans is installed. My netbeans configuration is pointing at a version of ant that appears to be correct, and which is being used by netbeans to run the build and the test operations.

Everything WORKS from a command prompt in windows (ant test), but it FAILS inside Netbeans.

The output window contains the above message, but the index.html contains this other weird error:

Class org.jedit.io.Native2ASCIIEncodingTest

unknown Error Forked Java VM exited abnormally. Please note the time 
in the report does not reflect the time until the VM exit.

junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the 
 VM exit.
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153) 

Wacky thing that is confusing me and may be what's going on. When I run the unit tests inside the IDE, the "properties" inside the junit report html for the failed test show ant.java.version 1.8 and a java 1.8 appropriate java.class.path, but my build.xml states target.java.version of 1.7. I have both JDK 1.7 and 1.8 installed. I thought that the version of Java specified in build.xml trumps whatever the workspace jdk selection is in netbeans, but not here.

Warren P
  • 65,725
  • 40
  • 181
  • 316
  • 1
    check http://stackoverflow.com/questions/1846329/forked-java-vm-exited-abnormally-error-from-junit-tests. try setting showoutput="yes" in build.xml file. So you would be able to know what has really happened – sasankad Feb 03 '16 at 03:26
  • The test target already has `showoutput="true"`. The only output I see before the test runs is what's in the question, it can't find the runner JUnitTestRunner. There is no stack trace. I turned off the fork setting (fork="false" now) and I don't get this strange crash in the forked VM, but the IDE still says no tests ran. But when I look at the test output index.html it now shows the tests passed. It seems like a junit+netbeans 8.1 bug. – Warren P Feb 03 '16 at 12:10

0 Answers0