Duplicate :
|
Sometimes NMT tests failed when executed in parallel with following error: java.lang.NoClassDefFoundError: jdk/test/lib/JDKToolFinder at jdk.test.lib.ProcessTools.createJavaProcessBuilder(ProcessTools.java:150) at jdk.test.lib.ProcessTools.createJavaProcessBuilder(ProcessTools.java:146) at CommandLineEmptyArgument.main(CommandLineEmptyArgument.java:38) at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110) at java.lang.Thread.run(java.base@9-internal/Thread.java:804) Caused by: java.lang.ClassNotFoundException: jdk.test.lib.JDKToolFinder at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base@9-internal/BuiltinClassLoader.java:366) at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base@9-internal/ClassLoaders.java:184) at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419) ... 9 more Adding explicit @build statements for test library classes can help to avoid such errors.