Jump to content

Error: "The system cannot find the file "C:\ProgramData\Oracle\Java\javapath\java.exe"


Arc

Recommended Posts

Hello, I've tried to set up a (modded) Minecraft server. I've done this in the past as well (last one I did was for 1.18 and it worked), and I usually do it by following the steps from "The Breakdown" Youtube channel (in this case this video https://www.youtube.com/watch?v=MO06XrLZxGI). Altough I always get an error at some point, it usually is towards the end when others have to join the server and I did always manage to fix the issue somehow. This time however, I got an unexpected error to which I couldn't find a solution myself or online.

After downloading "installing forge-1.19.3-44.1.23-installer.jar" from the Forge website, I've installed the client to the folder with the path that ends with "\AppData\Roaming\.minecraft". Then, I've installed the server to an empty folder on Desktop. After opening the run.bat file, I get the following message: "The system cannot find the file "C:\ProgramData\Oracle\Java\javapath\java.exe"

I have Java folders both on my Program Files (jdk-17) and Program Files(x86) (jre1.8.0_361) but none on the ProgramData. When I try to install jdk-17 it doesn't give me the option to install there, as it is a hidden folder.

I've tried the following methods already:

  • updated Java (before starting the whole process & whilst trying to troubleshoot)
  • uninstalled jdk and reinstalled it (I've kept jre because I vaguely remember that it was painful to download it)
  • checked if the client installation works/minecraft forge 19.3 runs 

 

As mentioned usually I somehow manage to make the server work, but this time I'm at a total loss. I would be very grateful for some insight and help in finding the solution to this problem. Thank you very much in advance!

 

Edit: this is what the run.at file looks like:

@echo off
REM Forge requires a configured set of both JVM and program arguments.
REM Add custom JVM arguments to the user_jvm_args.txt
REM Add custom program arguments {such as nogui} to this file in the next line before the %* or
REM  pass them to this script directly
java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.19.3-44.1.23/win_args.txt %*
pause

 

 

TLDR; I try to execute the run.bat file for the first time for a Minecraft server, and get the "The system cannot find the file "C:\ProgramData\Oracle\Java\javapath\java.exe" error.

 

Edited by Arc
Link to comment
Share on other sites

Hi, thanks for the quick reply!

That's definitely the source of the problem, I've edited the "C:\ProgramData\Oracle\Java\javapath" path to "C:\ProgramFiles\Java\jdk-17" by looking at this guide: https://www.java.com/en/download/help/path.html, but now I only get an "Press any key to continue..." message (i.e. the "path should be X" error doesn't show up anymore) :(

In case it's something much easier and I'm overcomplicating things, here is a screenshot of my PATH enviroment: https://drive.google.com/file/d/1v0PbGgHK0WmyNOl074cN0mF8UR_AfcKv/view?usp=share_link

I'm still at phase of trying things out, and I assume I'll have to restart at some point, but I don't have time to continue for today. I'll update once I continue and find the solution or need further help.

Thank you again for the suggestion!

 

Link to comment
Share on other sites

Isn't there a space in "Program Files"?

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

Hi  @warjort, if I understood your question correctly, I do have jdk17 on my Program files (C:\Program Files\Java\jdk-17) and jre 1.8 in Program files(x86) (C:\Program Files (x86)\Java\jre1.8.0_341). As for Disk Space, I have 5GB (I swear I had 10GB before starting this server adventure). If I understood your question wrong, please tell me so I can give accurate infromation.

I have tried:

  • restarting/ turning off and on my laptop,
  • installing forge 1.19.2 just to see if it makes any difference (it only takes (much) longer for the "Press any key to continue..." text, older servers type out the .bat file and don't do anything)

I honestly feel very stupid because I feel like it will end up being something very simple, and really appreciate any suggestions/feedback.

 

Edit: added the forge installer log as suggested by the support forum sticky post, don't know if it would help: https://github.com/Arca333/Minecraft

Edited by Arc
Additional information
Link to comment
Share on other sites

Just replace where it says "java" in your run.bat with

"C:\Program Files\Java\jdk-17\bin\java.exe"

or wherever the java17 executable is located.

That way you know exactly which java it is using.

The quotes are important because there is a space in the path.

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

It works!

 

When I edited and tried to run the program, it gave different errors. For testing, I tried to run "java -version", only to realize I have the same problem as the forge file. After deleting every trace of Java on my computer and reinstalling it, jdk17 and the jarfix for good measure, it finally works again! 

Thank you so much for your help, I couldn't have done it without it!

 

For prosperity's sake I'll write down how I resolved it (For Windows 10):

  1. Open Control Panel (can be written on the search bar)
  2. Programs > Uninstall a program
  3. Delete EVERY java program
  4. reinstall Java (https://www.java.com/en/download/manual.jsp, for me downloading the Windows Online version worked) and run it
  5. Download jdk17 (https://www.oracle.com/java/technologies/downloads/#jdk20-windows, x64 Installer) and run it
  6. Download jarfix (https://johann.loefflmann.net/downloads/jarfix.exe) and run it 

 

and that did it for me! I hope anyone who comes across the same issue manages to fix the problem with these steps.

 

Thank you again @warjort and @Hipposgrumm for your help :)

Link to comment
Share on other sites

20 minutes ago, Arc said:
  • Programs > Uninstall a program
  • Delete EVERY java program

Just to be clear, I'm pretty sure you mean all versions of Java and not everything that uses Java.

I'm not good at modding, but at least I can read a crash report (well enough). That's something, right?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.