Fix: Registry refers to a nonexistent Java Runtime – Launch4j

Some users report getting the “registry refers to a nonexistent Java Runtime Environment” error when trying to open certain application executables. Most affected users report that this issue started to occur abruptly ( they where previously able to run the same executable without issues).

The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted. The system cannot find the path specified
The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted.
The system cannot find the path specified

What is causing the “registry refers to a nonexistent Java Runtime Environment” error

We investigated the issue by trying to replicate the issue and looking at various user reports. This particular error message is an indicator that you have remnants from an old Java installation in your Registry editor.

Based on what we found, there are several common scenarios that will lead to the apparition of this issue:

  • The Registry contains entries that don’t lead to the actual Java path – This typically occurs if you move the software to a different directory (manually) after the initial installation. The issue can be rectified by manually removing the registry entries that don’t correspond manually.
  • Incomplete or corrupted Java Installation – Several users have managed to resolve this particular issue by uninstalling Java and then re-installing the JDK. User speculation suggests that a corrupted file or glitch might have caused this.

If you’re currently struggling to resolve this particular issue, this article will provide you with a collection of verified troubleshooting steps. Below you have several methods that other users in a similar situation have successfully used to resolve the issue.

For the best results, follow the methods below in order until you encounter a fix that resolves the problem in your particular scenario. Let’s begin!

Method 1: Removing inexistent registry entries for JavaHome and RuntimeLib

Several users encountering the same issue have managed to get the issue resolved by removing those JavaHome and RuntimeLib registry entries that don’t refer to an existent path.

Every JavaHome variable should refer to a path similar to \bin\client\jvm.dll while each RuntimeLib should refer to an existent jvm.dll file. But because this issue occurs, you might find one or multiple variables that do not have the corresponding path or file.

This might happen if you recently removed the software to another directory after you installed it. If you manage to find any registry variables, you’ll need them to remove them manually.

This procedure will require some manual work and a small amount of technical expertize, but it might allow you to resolve the issue without having to re-install the whole Java Runtime Environment. If you are prepared to go through with it, we have prepared a step by step guide through the whole thing. Here’s what you need to do:

  1. Press Windows key + R to open up a Run dialog box. Then, type “regedit” and press Enter to open up the Registry Editor. When prompted by the UAC (User Account Control), click Yes at the prompt.
    Run dialog: regedit
    Run dialog: regedit
  2. Inside the Registry Editor, use the left pane to navigate to the following location:
    Computer \ HKEY_LOCAL_MACHINE \ SOFTWARE \ JavaSoft \ Java Runtime  Environment
  3. Once you get there, select the first Java version located in the Java Runtime Environment folder and move over to the right pane.
  4. In the right pane, double-click on JavaHome and copy the entire Value data path to your clipboard.
    Copying the JavaHome path from registry Editor
    Copying the JavaHome path from Registry Editor
  5. Open-File Explorer and paste the location you’ve previously copied in the navigation bar. If the location leads somewhere, it means that the registry value has a corresponding path. If it doesn’t lead you anywhere, it means that the registry refers to a non-existent Java installation and it should be deleted.
    Verifying registry value for the corresponding path
    Verifying registry value for the corresponding path

    Note: If the Value data path dosen’t lead you anywhere, right-click on JavaHome and click Delete to get rid of the registry entry.

    Deleting the Registry entry with a non-corresponding installation path
    Deleting the Registry entry with a non-corresponding installation path
  6. Once JavaHome has been taken cared off, double-click on RuntimeLib and copy the Value data path in your clipboard.
    Copy the Value data of RuntimeLib to the clipboard
    Copy the Value data of RuntimeLib to the clipboard
  7. Same as before, open a File Explorer window and past the path you previously copied in the navigation bar. But this time, remove the last part “jvm.dll” before pressing Enter.
    Verifying if the Runtimelib has a corresponding path
    Verifying if the Runtimelib has a corresponding path

    Note: If you find a corresponding path, it means that the RuntimeLib registry value is functioning correctly. In the event that you get a message saying that Windows is unable to find the path, the registry value refers to a non-existent Java installation and needs to be removed. In this case, right-click on RuntimeLib and choose Delete to get rid of the value.

    Example of a non-existent registry path
    Example of a non-existent registry path
  8. Once the first Java Runtime Environment version has been dealt with, repeat steps 4 to 7 with every Java version that you have left under Java Runtime Environment.
    Repeating the same procedure with the remaining Java versions
    Repeating the same procedure with the remaining Java versions
  9. Once all registry entries have been verified and addressed, close Registry Editor and restart your machine and see if the error has been resolved at the next startup.

If this method was not successful or you’re simply looking for a more simple fix, move down to the next method below.

Method 2: Uninstalling Java and installing the Java JDK

If you’re encountering this issue when trying to launch Minecraft or a similar application that relies on the JDK, you might be able to resolve the issue by uninstalling the whole Java environment and then re-installing the JDK (Java Development Kit).

Here’s a quick guide on how to do this:

  1. Press Windows key + R to open up a Run dialog box. Then, type “appwiz.cpl” and press Enter to open up Programs and Features.
    Run dialog: appwiz.cpl
    Run dialog: appwiz.cpl
  2. Inside Programs and Features, click on the Publisher column, then scroll down to the entries published by Oracle Corporation.
  3. Next, proceed to uninstall every Java installation (or update) by right-clicking on each entry and clicking Uninstall. Then, follow the on-screen prompts to complete the uninstallation with each entry.
    Uninstalling every Java instalation
    Uninstalling every Java installation
  4. Once you uninstall the Java environment completely, restart your computer.
  5. At the next startup, visit this link (here) and click on on the Download button.
    Click on the JDK download button
    Click on the JDK download button
  6. In the next screen, scroll down to Java SE Development Kit and click the toggle associated with Accept Licence Agreement. Then, click on the executable download link associated with Windows.
    Downloading the JDK installer
    Downloading the JDK installer
  7. Open the JDK installer and follow the on-screen prompts to install the JDK environment on your PC. Restart your computer if not automatically prompted to do so when the process is complete.
  8. At the next startup, you should be able to start the application without encountering the  “registry refers to a nonexistent Java Runtime Environment” error.
ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.