java.io.FileNotFoundException: c:\rt.jar\java.util.concurrent\Executors.class (The system cannot find the path specified)
See original GitHub issue[provide a description of the issue]
Environment
- Operating System: Microsoft Windows [Version 10.0.19042.685]
- JDK version: java version “14.0.1” 2020-04-14
- Visual Studio Code version: 1.52.0
- Java extension version: v0.72.0
Steps To Reproduce
- Create a simple Java project that contains some plain code like the following.
package com.liudonghua.demos;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
/**
* Hello world!
*/
public final class App {
private App() {
}
/**
* Says hello to the world.
*
* @param args The arguments of the program.
* @throws ExecutionException
* @throws InterruptedException
*/
public static void main(String[] args) throws InterruptedException, ExecutionException {
ExecutorService executor = Executors.newCachedThreadPool();
MyTask task = new MyTask();
System.out.println("主线程启动线程池");
FutureTask<Integer> futureTask = new FutureTask<>(task);
executor.submit(futureTask); // 作为Runnable传入submit()中
System.out.println("主线程得到返回结果:" + futureTask.get()); // 作为Future获取结果
executor.shutdown();
}
}
/**
* simple task.
*/
class MyTask implements Callable<Integer> {
/**
*
*/
private static final int SLEEP_MILLIS = 1000;
/**
*
*/
private static final int ROUND = 3;
/**
*
*/
private static final int RETURN_VALUE = 100;
@Override
public Integer call() throws Exception {
System.out.println("子线程开始计算...");
for (int i = 0; i < ROUND; ++i) {
Thread.sleep(SLEEP_MILLIS);
System.out.println("子线程计算中,用时 " + (i + 1) + " 秒");
}
System.out.println("子线程计算完成,返回:100");
return RETURN_VALUE;
}
}
- Ctrl+click some system classes like
Executors.
Current Result
The empty window is shown. and some errors are shown in the output window.
java.io.FileNotFoundException: c:\rt.jar\java.util.concurrent\Executors.class (The system cannot find the path specified)
-----------------------------------------------------------------------------------------
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:212)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:154)
at de.fernflower.main.decompiler.ConsoleDecompiler.getBytecodeStream(Unknown Source)
at cz.a(Unknown Source)
at i.a(Unknown Source)
at i.a(Unknown Source)
at de.fernflower.main.decompiler.ConsoleDecompiler.addSpace(Unknown Source)
at de.fernflower.main.decompiler.ConsoleDecompiler.main(Unknown Source)
-----------------------------------------------------------------------------------------
java.lang.NullPointerException
at bW.a(Unknown Source)
at bW.<init>(Unknown Source)
at i.a(Unknown Source)
at i.a(Unknown Source)
at de.fernflower.main.decompiler.ConsoleDecompiler.addSpace(Unknown Source)
at de.fernflower.main.decompiler.ConsoleDecompiler.main(Unknown Source)
-----------------------------------------------------------------------------------------
Expected Result
Navigation to system class source previewer.
Additional Informations
I can click the run/debug button around the main method. And the JAVA_HOME system env environment is configured correctly. And I also have a valid java configuration in vscode like the following.
"java.home": "C:\\Program Files\\Java\\jdk-14.0.1",
"java.configuration.runtimes": [
{
"name": "JavaSE-1.8",
"path": "C:\\Program Files\\Java\\jdk1.8.0_152",
"default": true
},
{
"name": "JavaSE-14",
"path": "C:\\Program Files\\Java\\jdk-14.0.1"
}
],
"java.maven.downloadSources": true
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
java.io.FileNotFoundException: the system cannot find the file ...
The best solution is to know where your files are being saved, that is, print the folder: import java.io.File; import java.util.*; public class...
Read more >java.io.FileNotFoundException: The system cannot find the ...
java.io.FileNotFoundException: P:\Program Files\Apache Tomcat 4.0\webapps\IISOelearn\account.xml (The system cannot find the path specified)
Read more >Failed to run in windows server 10: java.lang ...
I am trying to deploy my application in Windows 2019 server within Tomcat ... (The system cannot find the path specified) at java.util.zip....
Read more >(The System Cannot Find The Path Specified) Jar Result
Constructs a FileNotFoundException with the specified detail message. Method Summary. Methods inherited from class java.lang.Throwable addSuppressed. Calling ...
Read more >SoapUI running in Docker Container throwing java.i...
xml (Read-only file system)], see error log for details 01:46:09,877 ERROR [errorlog] java.io.FileNotFoundException: /./reports/ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

我也碰到了相同的问题,现在解决了。
发现是cweijan.vscode-office这个插件导致的。
有两种解决方法
Thank you for figuring this out. I will close this issue now. You’d better to open an issue against
cweijan.vscode-officeextension.