java.lang.ClassCastException: sun.nio.fs.WindowsPath cannot be cast to java.io.File

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by sta-szek
, 1 year ago
via GitHub by bartmark
, 1 year ago
org.eclipse.jdt.core.dom.MarkerAnnotation cannot be cast to org.eclipse.jdt.core.dom.Modifier
via GitHub by ebrigand
, 1 year ago
com.tesco.disco.shareable.KeyCache cannot be cast to com.tesco.disco.shareable.KeyCache
java.lang.ClassCastException: sun.nio.fs.WindowsPath cannot be cast to java.io.File
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.junit.platform.engine.discovery.DiscoverySelectors.selectClasspathRoots(DiscoverySelectors.java:68)
at org.junit.platform.console.tasks.DiscoveryRequestCreator.createBuilderForClasspathScanning(DiscoveryRequestCreator.java:66)
at org.junit.platform.console.tasks.DiscoveryRequestCreator.createRequestBuilder(DiscoveryRequestCreator.java:59)
at org.junit.platform.console.tasks.DiscoveryRequestCreator.toDiscoveryRequest(DiscoveryRequestCreator.java:52)
at org.junit.platform.console.tasks.ExecuteTestsTask.executeTests(ExecuteTestsTask.java:61)
at org.junit.platform.console.tasks.ExecuteTestsTask.lambda$execute$1(ExecuteTestsTask.java:54)
at org.junit.platform.console.tasks.CustomContextClassLoaderExecutor.invoke(CustomContextClassLoaderExecutor.java:33)
at org.junit.platform.console.tasks.ExecuteTestsTask.execute(ExecuteTestsTask.java:54)
at org.junit.platform.console.tasks.ConsoleTaskExecutor.executeTask(ConsoleTaskExecutor.java:38)
at org.junit.platform.console.ConsoleLauncher.execute(ConsoleLauncher.java:54)
at org.junit.platform.console.ConsoleLauncher.main(ConsoleLauncher.java:39)

Users with the same issue

2 times, 7 months ago
Samebug visitor profile picture
Unknown user
3 times, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.