question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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
  1. 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;
    }
}

  1. 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:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
maoziliangcommented, Dec 16, 2020

我也碰到了相同的问题,现在解决了。

发现是cweijan.vscode-office这个插件导致的。 image

有两种解决方法

  1. 禁用掉cweijan.vscode-office插件
  2. 配置*.class的打开方式
    "workbench.editorAssociations": [
        {
          "viewType": "default",
          "filenamePattern": "*.class"
        }
    ]
    
0reactions
testforstephencommented, Dec 16, 2020

Thank you for figuring this out. I will close this issue now. You’d better to open an issue against cweijan.vscode-office extension.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found