mojira.dev
MCL-12092

Profiles cannot find default Java runtime when using --workDir

I moved all the contents of my %APPDATA%\.minecraft folder to the folder E:\Minecraft\minecraft-c0wg0d.

I have a shortcut to start the launcher with the following:

E:\Minecraft\minecraft-c0wg0d\MinecraftLauncher.exe --workDir . --launcherui

For all my profiles, I do NOT specify the javaw.exe location, because it is in the default location, which is .\runtime\jre-x64\bin\javaw.exe.  If I try to launch Minecraft, I get the following error:

---------------------

Unable to locate the Java runtime.
Error details: The operation completed successfully.

Filename on disk:
Path: .
Exists: Directory

-----------------------

 

If I manually specify the javaw.exe file, it works fine.  I have dozens of profiles and I don't want to have to specify the Java runtime location for all of them, and I don't understand why it can't find it in the current workDir directory.  This seems like a bug to me.

Linked issues

Comments 2

Edit: big oooof.

The issue actually seems to be optifine installed in a folder with a space in the name. I just finished the steps below and created a new .minecraft instance and downloaded and checked all my versions. Then I installed optifine which broke all game versions, even profiles without optifine. I had a hunch this might be the issue and renamed the folder removing the space character. I adjusted my launch script and launched Minecraft. Et voilà, what didn't work two minutes ago now did. Hope this solves your issue as well, make sure to remove all special characters from your folder names, if possible rename them to be as unproblematic as possible (e.g. not too long)

 

Hey, I had the same error and same situation (using --workDir parameter). However your workaround didn't work for me so the issue probably is a bit different, but I found out that it must have been my .minecraft folder making trouble. When I made the game create a new .minecraft folder it worked fine. The folder probably got corrupted somewhere when copying back and forth from C: to D:.

Somewhere in between I did delete the folders in the game directory (the directory with the minecraft.exe, not the workDir) as well but I'm not sure if that contributed to the fix.

Try modifying the workDir parameter to a directory that does not exist so it creates it. Launch a random version and see if the game works. If not try deleting all files in the game directory and create another workDir, then it should definitely work. I'm afraid you then will have to try and manually import your old profiles somehow, even thou you said you have a lot of them.

 

Thank you for your report!
We're tracking this issue in MCL-20059, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

migrated

(Unassigned)

Confirmed

Retrieved