Windows cannot find 'C:\Program Files\Java\jdk-17\bin\javaw.exe'. Make sure you typed the name correctly, and then try again.

Anonymous
2023-02-21T02:56:13+00:00

I'm trying to get either Adoptium JDK or the official Oracle JDKs to work on Windows 11 22H2. Whenever I try to install it and use it, literally the only file that doesn't work is javaw.exe. Problem pictured below. Clearly the file exists; it even comes up when I do dir <installation path> in Command Prompt. The Oracle JDK in particular is installed when these screenshots were taken.

Windows for home | Windows 11 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Ramesh Srinivasan 173.4K Reputation points Volunteer Moderator
    2023-02-21T05:34:46+00:00

    AMD Crash Defender Service is blocking javaw.exe. Download and run java_fix.reg. That should do the trick!

    4 people found this answer helpful.
    0 comments No comments

21 additional answers

Sort by: Most helpful
  1. Anonymous
    2023-02-21T04:14:22+00:00

    Please shift + right-click javaw.exe in File Explorer.

    Click Start/Run.

    Paste the path from the clipboard (including the enclosed double quotes).

    Click OK.

    Does it work?

    Also, can you run C:\Program Files\Java\jdk-17\bin\javaw.exe in Command Prompt?

    When I Shift+RClick > Copy as path, then paste it into the command prompt to run, it says it cannot find the file. However, when I drag the file from the explorer window into the command prompt and run it like that, it works. Extremely weird.

    I will install Adoptium instead of the Oracle JDK, restart, and see if it fixes itself.

    Update: I've done just that. Now the executable won't start no matter how I execute it.

    Just to make sure, I tried executing jconsole.exe from the command line. Works fine.

    0 comments No comments
  2. Ramesh Srinivasan 173.4K Reputation points Volunteer Moderator
    2023-02-21T04:21:49+00:00

    Running javaw.exe without any switches returns quickly to the prompt on my computer.

    Image

    Looks like the process hangs on your computer. Javaw.exe seems to have been locked by a program or service.

    Please try Option 2 in this article (Process Explorer) to find the offending process that has locked Javaw.exe. Run ProcExp as administrator.

    0 comments No comments
  3. Anonymous
    2023-02-21T04:27:39+00:00

    Running javaw.exe without any switches returns quickly to the prompt on my computer.

    Image

    Looks like the process hangs on your computer. Javaw.exe seems to have been locked by a program or service.

    Please try Option 2 in this article (Process Explorer) to find the offending process that has locked Javaw.exe. Run ProcExp as administrator

    Started ProcExp as Admin, searched for javaw/javaw.exe, no matches.

    Image

    Did the same thing on ProcessHacker2, same result.

    0 comments No comments
  4. Anonymous
    2023-02-21T04:32:05+00:00

    Windows search seems to find the file perfectly fine, as well.

    0 comments No comments