Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not find or load main class net.minecraft.client.main.Main #171

Closed
RiverRyan3000 opened this issue Aug 20, 2023 · 9 comments · Fixed by #175
Closed

Error: Could not find or load main class net.minecraft.client.main.Main #171

RiverRyan3000 opened this issue Aug 20, 2023 · 9 comments · Fixed by #175
Assignees
Labels
api This issue is related to the API or its implementation bug Something isn't working

Comments

@RiverRyan3000
Copy link

when i run

portablemc --main-dir files --work-dir files start 1.16.5

it passes

[  OK  ] Loaded version 1.16.5
[  OK  ] Loaded Mojang java 8u51
[  OK  ] Checked version jar
[  OK  ] Checked 2615 assets version 1.16
[  OK  ] Checked 33 class and 8 native libraries
[  OK  ] Using logger client-1.12

Error: Could not find or load main class net.minecraft.client.main.Main

i tried running it in administrator but it didnt work

@mindstorm38
Copy link
Owner

I think the problem come from the launcher... Can you try with the full path just to check?

For the nerds: I think that the pwd given to the java process cause all relative paths to be resolved from it, so no jar file can be resolved.

@mindstorm38 mindstorm38 self-assigned this Aug 20, 2023
@mindstorm38 mindstorm38 added the bug Something isn't working label Aug 20, 2023
@mindstorm38
Copy link
Owner

We're good for a 4.0.2 patch, thank you!

@RiverRyan3000
Copy link
Author

i tried with the full path and its still the same error

portablemc --main-dir C:\luncher_tests\files --work-dir C:\luncher_tests\files start 1.16.5

and i also tried just starting it, without the --main-dir and --work-dir

portablemc start 1.16.5

and its still passing the same error

@mindstorm38
Copy link
Owner

Could you try with portablemc -vv start 1.16.5, and give us the full command line?

@mindstorm38
Copy link
Owner

At first glance, it looks like #170

@RiverRyan3000
Copy link
Author

[  OK  ] Loaded version 1.16.5
[  OK  ] Loaded Mojang java 8u51
[  OK  ] Checked version jar
[  OK  ] Checked 2615 assets version 1.16
[  OK  ] Checked 33 class and 8 native libraries
[  OK  ] Using logger client-1.12
[ INFO ] Applied the following fixes:
         Fixed authlib for 1.16.4 or 1.16.5: True

C:\Users\river\AppData\Roaming\.minecraft\jvm\jre-legacy\bin\javaw.exe -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Dos.name=Windows 10 -Dos.version=10.0 -Djava.library.path=C:\Users\river\AppData\Roaming\.minecraft\bin\d5977bd7-0ed6-4054-8577-f622f66485fc -Dminecraft.launcher.brand=portablemc -Dminecraft.launcher.version=4.0.1 -cp C:\Users\river\AppData\Roaming\.minecraft\libraries\com\mojang\patchy\1.3.9\patchy-1.3.9.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\oshi-project\oshi-core\1.1\oshi-core-1.1.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\net\java\dev\jna\jna\4.4.0\jna-4.4.0.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\net\java\dev\jna\platform\3.4.0\platform-3.4.0.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\com\ibm\icu\icu4j\66.1\icu4j-66.1.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\com\mojang\javabridge\1.0.22\javabridge-1.0.22.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\net\sf\jopt-simple\jopt-simple\5.0.3\jopt-simple-5.0.3.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\io\netty\netty-all\4.1.25.Final\netty-all-4.1.25.Final.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\com\google\guava\guava\21.0\guava-21.0.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\commons-io\commons-io\2.5\commons-io-2.5.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\com\mojang\brigadier\1.0.17\brigadier-1.0.17.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\com\mojang\datafixerupper\4.0.26\datafixerupper-4.0.26.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\com\google\code\gson\gson\2.8.0\gson-2.8.0.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\apache\httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\apache\httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\it\unimi\dsi\fastutil\8.2.1\fastutil-8.2.1.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\apache\logging\log4j\log4j-api\2.8.1\log4j-api-2.8.1.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\apache\logging\log4j\log4j-core\2.8.1\log4j-core-2.8.1.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl\3.2.2\lwjgl-3.2.2.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl-jemalloc\3.2.2\lwjgl-jemalloc-3.2.2.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl-openal\3.2.2\lwjgl-openal-3.2.2.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl-opengl\3.2.2\lwjgl-opengl-3.2.2.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl-glfw\3.2.2\lwjgl-glfw-3.2.2.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl-stb\3.2.2\lwjgl-stb-3.2.2.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\org\lwjgl\lwjgl-tinyfd\3.2.2\lwjgl-tinyfd-3.2.2.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\com\mojang\text2speech\1.11.3\text2speech-1.11.3.jar;C:\Users\river\AppData\Roaming\.minecraft\libraries\com\mojang\authlib\2.2.30\authlib-2.2.30.jar;C:\Users\river\AppData\Roaming\.minecraft\versions\1.16.5\1.16.5.jar -Dlog4j.configurationFile=C:\Users\river\AppData\Roaming\.minecraft\assets\log_configs\client-1.12.xml -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M net.minecraft.client.main.Main --username fc4091db --version 1.16.5 --gameDir C:\Users\river\AppData\Roaming\.minecraft --assetsDir C:\Users\river\AppData\Roaming\.minecraft\assets --assetIndex 1.16 --uuid fc4091db2f795c7899fa8436d73a9406 --accessToken  --userType  --versionType release
Error: Could not find or load main class net.minecraft.client.main.Main

@mindstorm38
Copy link
Owner

Is the following file existings: C:\Users\river\AppData\Roaming\.minecraft\versions\1.16.5\1.16.5.jar
If so, can you show us its content (open as a ZIP)?

mindstorm38 added a commit that referenced this issue Aug 20, 2023
…aths are still usable in the launcher code, but when running subprocesses, it is important to make absolute paths. #171
@mindstorm38 mindstorm38 added the api This issue is related to the API or its implementation label Aug 20, 2023
@RiverRyan3000
Copy link
Author

it exists but when i opened it as a zip it was empty, and the size of it was 0kb
but when i removed the whole .minecraft folder and reinstall it with the minecraft luncher, than using the version file for portablemc it worked, but it still passes the same error when using --main-dir

@mindstorm38
Copy link
Owner

but it still passes the same error when using --main-dir

I think the patch I worked on today should fix this, I'll tell you when I release it so you can try

@mindstorm38 mindstorm38 linked a pull request Aug 23, 2023 that will close this issue
mindstorm38 added a commit that referenced this issue Aug 27, 2023
…aths are still usable in the launcher code, but when running subprocesses, it is important to make absolute paths. #171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api This issue is related to the API or its implementation bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants