java.lang.ClassCastException

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

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Stack trace

  • 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)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Михайло ТітовМихайло Тітов
3 times, last one
tvrmsmithtvrmsmith
2 times, last one
nasimknasimk
Once,
aidoanaidoan
2 times, last one
serious2monkeysserious2monkeys
Once,
2 more bugmates