JDK-8157957 : ClassNotFoundException: jdk.test.lib.JDKToolFinder
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-05-26
  • Updated: 2021-09-15
  • Resolved: 2016-08-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b135Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
----------System.err:(20/1451)----------
java.lang.NoClassDefFoundError: jdk/test/lib/JDKToolFinder
	at jdk.test.lib.ProcessTools.createJavaProcessBuilder(ProcessTools.java:131)
	at jdk.test.lib.ProcessTools.createJavaProcessBuilder(ProcessTools.java:127)
	at CommandLineTurnOffNMT.main(CommandLineTurnOffNMT.java:38)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
	at jdk.internal.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:843)
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:185)
	at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419)
	... 9 more
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/b61ee43309f3 User: lana Date: 2016-09-07 20:26:15 +0000
07-09-2016

URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/1cbffa2beba6 User: lana Date: 2016-09-07 20:26:04 +0000
07-09-2016

URL: http://hg.openjdk.java.net/jdk9/jdk9/rev/2a8815d86b93 User: lana Date: 2016-09-07 20:25:53 +0000
07-09-2016

URL: http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/1cbffa2beba6 User: ctornqvi Date: 2016-08-19 18:37:26 +0000
19-08-2016

URL: http://hg.openjdk.java.net/jdk9/hs/rev/2a8815d86b93 User: ctornqvi Date: 2016-08-19 18:37:23 +0000
19-08-2016

URL: http://hg.openjdk.java.net/jdk9/hs/jdk/rev/b61ee43309f3 User: ctornqvi Date: 2016-08-19 18:37:22 +0000
19-08-2016

To follow up on [~stefank]'s reproducer in JDK-8154184, which requires the use of an explicit "rm" to remove class files, I have found a reliable reproducer that fails without doing any "rm". See attachment jtreg_library_bug.tar.gz. Details are in the README and Makefile. The cause is inconsistent use of @library and @build. However, I don't believe the proper fix is to "add more @build". I'll start an e-mail discussion to try to find the proper fix. Here's excerpt from the Makefile: # The problem is caused by inconsistent use of @library and @build. As a result, although Test3 # indirectly depends on lib/X, jtreg fails to make this class available before executing Test3. # # To see the error in action, run "make bad": # # [1] After Test1 and Test2 are executed, the following classes are created # # out/work/classes/testlibrary/lib/Y.class # out/work/classes/a/lib/X.class # out/work/classes/a/Test1.class # out/work/classes/a/Test2.class # # [2] When building Test3, jtreg/javac can only infer that lib/Y is needed. Because # testlibrary/lib/Y.class already exists, javac happily builds Test3.class. Javac # does not resolve all transitive dependencies, so it doesn't need lib/X.class in order # to build Test3.class # # So now we have these classes # # out/work/classes/b/Test3.class # out/work/classes/testlibrary/lib/Y.class # out/work/classes/a/lib/X.class # out/work/classes/a/Test1.class # out/work/classes/a/Test2.class # # [3] Test3 is executed with CLASSPATH=classes/b:classes/testlibrary. Therefore, the JVM cannot find # lib/X.class, which lives under classes/a # # The problem happens even if the test case uses "@build lib.Y". Try "make bad3" and see c/Test5.java
23-07-2016

RULE "compiler/rtm/cli/TestRTMSpinLoopCountOption.java" Exception java.lang.ClassNotFoundException: jdk.test.lib.Platform
28-06-2016

I've added some comments that describe (IMHO) the probable reason for this bug in JDK-8154184.
20-06-2016

See the notes that I've added to JDK-8157958. I think there is a problem with the test library download to this test machine.
26-05-2016