Kron4ek / minecraft-vortex-launcher

Fast, lightweight and easy to use Minecraft launcher
GNU General Public License v3.0
306 stars 30 forks source link

It is impossible to launch the new module-based Forge for 1.17 without some actions taken on every user's side #22

Closed Tratnic closed 2 years ago

Tratnic commented 2 years ago

Description of the current situation and why the new module-based Forge for 1.17 no longer works out of the box with Vortex Launcher

As everyone probably knows, just a few days ago Forge for version 1.17 was released. One of the biggest changes was the separation of FML from Forge again (like it was several years and versions ago), and along with that Forge has been based on a custom implementation on the relatively new Java 9+ module system (for more information for general users, for example, you can read this official announcement).

While the modularity sounds like a good future-proof idea, it made the current launching method used over the years not sufficient to properly launch the new module-based Forge for both the client and the server. This issue has been addressed by the Forge team differently for both the client and the server. Since Vortex Launcher is not a server launcher, I will talk here about the client solution only.

So from now on, it seems that the JSON manifest file that comes with Forge will look like this: Forge-117-manifest

Array game is known to everyone, it has been there for years, and Vortex Launcher already makes use of it, but jvm is brand new. It plays a very important role in version 1.17 and the new module-based Forge because without the parameters from there, it's impossible to properly launch the new module-based Forge for 1.17 at all. Vortex Launcher is not aware of the existence of the new jvm array, so every user has to do some workarounds on their own.

From what I have been able to determine and test:


Description of a workaround I've found that makes the new module-based Forge for 1.17 work with Vortex Launcher again

If by any chance you're here because you're looking for help launching the new module-based Forge for 1.17 through Vortex Launcher, you've come to the right place.

What you can do as a workaround to make it work:

  1. Download the Forge installer, run it, and wait for it to finish (nothing changes here)
  2. Navigate to ~/.minecraft/versions/<Forge_version_string> (e.g. ~/.minecraft/versions/1.17.1-forge-37.0.5) and open the only JSON manifest file that should be there (e.g. 1.17.1-forge-37.0.5.json) using your favorite text editor.
  3. In the open file, look for the jvm array (it should look similar to the one shown above). From now on, only the contents of this array should interest you, nothing else, so whenever I talk about lines, I will always mean only these. Note: JSON array always begins with [ and ends with ], so the contents that should interest you should be between the first [ and ] after the word "jvm".
  4. In the first line, copy everything that is between the first and the last " in the line, paste it into a new text file (e.g. "I'm a sample text", should become I'm a sample text), and press Space to separate it from the next line you will deal with in the next step.
  5. Repeat step 4 above until all lines are copied from the JSON manifest file to the new text file. The end result should be something like this (it's provided by me for reference only, do not copy it as it's something that changes with every Forge release!):
    -DlegacyClassPath=${classpath} -DignoreList=bootstraplauncher-0.1.15.jar,securejarhandler-0.9.46.jar,asm-commons-9.1.jar,asm-util-9.1.jar,asm-analysis-9.1.jar,asm-tree-9.1.jar,asm-9.1.jar,client-extra,fmlcore,javafmllanguage,mclanguage,forge-1.17.1-37.0.5,1.17.1-forge-37.0.5 -DmergeModules=jna-5.8.0.jar,jna-platform-58.0.jar,java-objc-bridge-1.0.0.jar -DlibraryDirectory=${library_directory} -p ${library_directory}/cpw/mods/bootstraplauncher/0.1.15/bootstraplauncher-0.1.15.jar${classpath_separator}${library_directory}/cpw/mods/securejarhandler/0.9.46/securejarhandler-0.9.46.jar${classpath_separator}${library_directory}/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.jar${classpath_separator}${library_directory}/org/ow2/asm/asm-util/9.1/asm-util-9.1.jar${classpath_separator}${library_directory}/org/ow2/asm/asm-analysis/9.1/asm-analysis-9.1.jar${classpath_separator}${library_directory}/org/ow2/asm/asm-tree/9.1/asm-tree-9.1.jar${classpath_separator}${library_directory}/org/ow2/asm/asm/9.1/asm-9.1.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar=cpw.mods.securejarhandler --add-exports java.base/sun.security.util=cpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming
  6. Now that you have everything important copied to the new text file, you can close the JSON manifest file. Then look for ${classpath}, ${library_directory}, and ${classpath_separator} in the new text file.
  7. Replace ${classpath} with the very long list of class paths that goes after -cp when you launch Minecraft 1.17 with Forge. Unfortunately, I don't know an easy and simple way to get this list. The only way I know is to launch Minecraft 1.17 with Forge first, then (quickly?) get all the arguments that have been passed to the running Java process (how to do this depends on the system you use, and as I don't have an experience with each of them, you will probably have to do some research on your own on the Internet), and then copy the needed part only (i.e. the very long list of class paths that goes after -cp). Now you can replace ${classpath} with what you just copied. The end result should be something like this (it's provided by me for reference only, do not copy it as it's something that changes with every Forge release!):
    -DlegacyClassPath=libraries\cpw\mods\securejarhandler\0.9.46\securejarhandler-0.9.46.jar;libraries\org\ow2\asm\asm\9.1\asm-9.1.jar;libraries\org\ow2\asm\asm-commons\9.1\asm-commons-9.1.jar;libraries\org\ow2\asm\asm-tree\9.1\asm-tree-9.1.jar;libraries\org\ow2\asm\asm-util\9.1\asm-util-9.1.jar;libraries\org\ow2\asm\asm-analysis\9.1\asm-analysis-9.1.jar;libraries\net\minecraftforge\accesstransformers\8.0.4\accesstransformers-8.0.4.jar;libraries\org\antlr\antlr4-runtime\4.9.1\antlr4-runtime-4.9.1.jar;libraries\net\minecraftforge\eventbus\5.0.3\eventbus-5.0.3.jar;libraries\net\minecraftforge\forgespi\4.0.9\forgespi-4.0.9.jar;libraries\net\minecraftforge\coremods\5.0.1\coremods-5.0.1.jar;libraries\cpw\mods\modlauncher\9.0.7\modlauncher-9.0.7.jar;libraries\net\minecraftforge\unsafe\0.2.0\unsafe-0.2.0.jar;libraries\com\electronwill\night-config\core\3.6.3\core-3.6.3.jar;libraries\com\electronwill\night-config\toml\3.6.3\toml-3.6.3.jar;libraries\org\apache\maven\maven-artifact\3.6.3\maven-artifact-3.6.3.jar;libraries\org\apache\commons\commons-lang3\3.8.1\commons-lang3-3.8.1.jar;libraries\net\jodah\typetools\0.8.3\typetools-0.8.3.jar;libraries\org\apache\logging\log4j\log4j-api\2.14.1\log4j-api-2.14.1.jar;libraries\org\apache\logging\log4j\log4j-core\2.14.1\log4j-core-2.14.1.jar;libraries\net\minecrell\terminalconsoleappender\1.2.0\terminalconsoleappender-1.2.0.jar;libraries\org\jline\jline-reader\3.12.1\jline-reader-3.12.1.jar;libraries\org\jline\jline-terminal\3.12.1\jline-terminal-3.12.1.jar;libraries\net\sf\jopt-simple\jopt-simple\5.0.4\jopt-simple-5.0.4.jar;libraries\org\openjdk\nashorn\nashorn-core\15.1.1\nashorn-core-15.1.1.jar;libraries\com\google\guava\guava\21.0\guava-21.0.jar;libraries\com\google\code\gson\gson\2.8.0\gson-2.8.0.jar;libraries\cpw\mods\bootstraplauncher\0.1.15\bootstraplauncher-0.1.15.jar;libraries\net\minecraftforge\fmlloader\1.17.1-37.0.5\fmlloader-1.17.1-37.0.5.jar;libraries\com\mojang\blocklist\1.0.5\blocklist-1.0.5.jar;libraries\com\mojang\patchy\2.1.6\patchy-2.1.6.jar;libraries\com\github\oshi\oshi-core\5.7.5\oshi-core-5.7.5.jar;libraries\net\java\dev\jna\jna\5.8.0\jna-5.8.0.jar;libraries\net\java\dev\jna\jna-platform\5.8.0\jna-platform-5.8.0.jar;libraries\org\slf4j\slf4j-api\1.8.0-beta4\slf4j-api-1.8.0-beta4.jar;libraries\org\apache\logging\log4j\log4j-slf4j18-impl\2.14.1\log4j-slf4j18-impl-2.14.1.jar;libraries\com\ibm\icu\icu4j\66.1\icu4j-66.1.jar;libraries\com\mojang\javabridge\1.1.23\javabridge-1.1.23.jar;libraries\io\netty\netty-all\4.1.25.Final\netty-all-4.1.25.Final.jar;libraries\commons-io\commons-io\2.5\commons-io-2.5.jar;libraries\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;libraries\com\mojang\brigadier\1.0.18\brigadier-1.0.18.jar;libraries\com\mojang\datafixerupper\4.0.26\datafixerupper-4.0.26.jar;libraries\com\mojang\authlib\2.3.31\authlib-2.3.31.jar;libraries\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;libraries\org\apache\httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar;libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;libraries\org\apache\httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar;libraries\it\unimi\dsi\fastutil\8.2.1\fastutil-8.2.1.jar;libraries\org\lwjgl\lwjgl\3.2.2\lwjgl-3.2.2.jar;libraries\org\lwjgl\lwjgl-jemalloc\3.2.2\lwjgl-jemalloc-3.2.2.jar;libraries\org\lwjgl\lwjgl-openal\3.2.2\lwjgl-openal-3.2.2.jar;libraries\org\lwjgl\lwjgl-opengl\3.2.2\lwjgl-opengl-3.2.2.jar;libraries\org\lwjgl\lwjgl-glfw\3.2.2\lwjgl-glfw-3.2.2.jar;libraries\org\lwjgl\lwjgl-stb\3.2.2\lwjgl-stb-3.2.2.jar;libraries\org\lwjgl\lwjgl-tinyfd\3.2.2\lwjgl-tinyfd-3.2.2.jar;libraries\com\mojang\text2speech\1.11.3\text2speech-1.11.3.jar;versions\1.17.1\1.17.1.jar
  8. Look at the end of the very long list of class paths that you just replaced ${classpath} with. There should be something like versions/<Minecraft_version_number>/<Minecraft_version_number>.jar. Replace it with versions/<Forge_version_string>/<Forge_version_string>.jar where <Forge_version_string> is exactly the same as in step 2 above (e.g. versions/1.17.1/1.17.1.jar could be replaced with versions/1.17.1-forge-37.0.5/1.17.1-forge-37.0.5.jar).
  9. Replace ${library_directory} with just libraries.
  10. Replace ${classpath_separator} with ; if you are on Windows, or with : if you are on Unix-like systems. The end result should be something like this (it's provided by me for reference only, do not copy it as it contains OS-dependent things that changes with every Forge release and may also be changed by Mojang with any Minecraft update!):
    -DlegacyClassPath=libraries\cpw\mods\securejarhandler\0.9.46\securejarhandler-0.9.46.jar;libraries\org\ow2\asm\asm\9.1\asm-9.1.jar;libraries\org\ow2\asm\asm-commons\9.1\asm-commons-9.1.jar;libraries\org\ow2\asm\asm-tree\9.1\asm-tree-9.1.jar;libraries\org\ow2\asm\asm-util\9.1\asm-util-9.1.jar;libraries\org\ow2\asm\asm-analysis\9.1\asm-analysis-9.1.jar;libraries\net\minecraftforge\accesstransformers\8.0.4\accesstransformers-8.0.4.jar;libraries\org\antlr\antlr4-runtime\4.9.1\antlr4-runtime-4.9.1.jar;libraries\net\minecraftforge\eventbus\5.0.3\eventbus-5.0.3.jar;libraries\net\minecraftforge\forgespi\4.0.9\forgespi-4.0.9.jar;libraries\net\minecraftforge\coremods\5.0.1\coremods-5.0.1.jar;libraries\cpw\mods\modlauncher\9.0.7\modlauncher-9.0.7.jar;libraries\net\minecraftforge\unsafe\0.2.0\unsafe-0.2.0.jar;libraries\com\electronwill\night-config\core\3.6.3\core-3.6.3.jar;libraries\com\electronwill\night-config\toml\3.6.3\toml-3.6.3.jar;libraries\org\apache\maven\maven-artifact\3.6.3\maven-artifact-3.6.3.jar;libraries\org\apache\commons\commons-lang3\3.8.1\commons-lang3-3.8.1.jar;libraries\net\jodah\typetools\0.8.3\typetools-0.8.3.jar;libraries\org\apache\logging\log4j\log4j-api\2.14.1\log4j-api-2.14.1.jar;libraries\org\apache\logging\log4j\log4j-core\2.14.1\log4j-core-2.14.1.jar;libraries\net\minecrell\terminalconsoleappender\1.2.0\terminalconsoleappender-1.2.0.jar;libraries\org\jline\jline-reader\3.12.1\jline-reader-3.12.1.jar;libraries\org\jline\jline-terminal\3.12.1\jline-terminal-3.12.1.jar;libraries\net\sf\jopt-simple\jopt-simple\5.0.4\jopt-simple-5.0.4.jar;libraries\org\openjdk\nashorn\nashorn-core\15.1.1\nashorn-core-15.1.1.jar;libraries\com\google\guava\guava\21.0\guava-21.0.jar;libraries\com\google\code\gson\gson\2.8.0\gson-2.8.0.jar;libraries\cpw\mods\bootstraplauncher\0.1.15\bootstraplauncher-0.1.15.jar;libraries\net\minecraftforge\fmlloader\1.17.1-37.0.5\fmlloader-1.17.1-37.0.5.jar;libraries\com\mojang\blocklist\1.0.5\blocklist-1.0.5.jar;libraries\com\mojang\patchy\2.1.6\patchy-2.1.6.jar;libraries\com\github\oshi\oshi-core\5.7.5\oshi-core-5.7.5.jar;libraries\net\java\dev\jna\jna\5.8.0\jna-5.8.0.jar;libraries\net\java\dev\jna\jna-platform\5.8.0\jna-platform-5.8.0.jar;libraries\org\slf4j\slf4j-api\1.8.0-beta4\slf4j-api-1.8.0-beta4.jar;libraries\org\apache\logging\log4j\log4j-slf4j18-impl\2.14.1\log4j-slf4j18-impl-2.14.1.jar;libraries\com\ibm\icu\icu4j\66.1\icu4j-66.1.jar;libraries\com\mojang\javabridge\1.1.23\javabridge-1.1.23.jar;libraries\io\netty\netty-all\4.1.25.Final\netty-all-4.1.25.Final.jar;libraries\commons-io\commons-io\2.5\commons-io-2.5.jar;libraries\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;libraries\com\mojang\brigadier\1.0.18\brigadier-1.0.18.jar;libraries\com\mojang\datafixerupper\4.0.26\datafixerupper-4.0.26.jar;libraries\com\mojang\authlib\2.3.31\authlib-2.3.31.jar;libraries\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;libraries\org\apache\httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar;libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;libraries\org\apache\httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar;libraries\it\unimi\dsi\fastutil\8.2.1\fastutil-8.2.1.jar;libraries\org\lwjgl\lwjgl\3.2.2\lwjgl-3.2.2.jar;libraries\org\lwjgl\lwjgl-jemalloc\3.2.2\lwjgl-jemalloc-3.2.2.jar;libraries\org\lwjgl\lwjgl-openal\3.2.2\lwjgl-openal-3.2.2.jar;libraries\org\lwjgl\lwjgl-opengl\3.2.2\lwjgl-opengl-3.2.2.jar;libraries\org\lwjgl\lwjgl-glfw\3.2.2\lwjgl-glfw-3.2.2.jar;libraries\org\lwjgl\lwjgl-stb\3.2.2\lwjgl-stb-3.2.2.jar;libraries\org\lwjgl\lwjgl-tinyfd\3.2.2\lwjgl-tinyfd-3.2.2.jar;libraries\com\mojang\text2speech\1.11.3\text2speech-1.11.3.jar;versions\1.17.1-forge-37.0.5\1.17.1-forge-37.0.5.jar -DignoreList=bootstraplauncher-0.1.15.jar,securejarhandler-0.9.46.jar,asm-commons-9.1.jar,asm-util-9.1.jar,asm-analysis-9.1.jar,asm-tree-9.1.jar,asm-9.1.jar,client-extra,fmlcore,javafmllanguage,mclanguage,forge-1.17.1-37.0.5,1.17.1-forge-37.0.5 -DmergeModules=jna-5.8.0.jar,jna-platform-58.0.jar,java-objc-bridge-1.0.0.jar -DlibraryDirectory=libraries -p libraries/cpw/mods/bootstraplauncher/0.1.15/bootstraplauncher-0.1.15.jar;libraries/cpw/mods/securejarhandler/0.9.46/securejarhandler-0.9.46.jar;libraries/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.jar;libraries/org/ow2/asm/asm-util/9.1/asm-util-9.1.jar;libraries/org/ow2/asm/asm-analysis/9.1/asm-analysis-9.1.jar;libraries/org/ow2/asm/asm-tree/9.1/asm-tree-9.1.jar;libraries/org/ow2/asm/asm/9.1/asm-9.1.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar=cpw.mods.securejarhandler --add-exports java.base/sun.security.util=cpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming
  11. Open Vortex Launcher, click "Settings", and tick the checkbox next to "Use custom launch parameters". Then copy the text from the new text file you worked with a while ago. Now click on the text box at the top of the Vortex Launcher settings window, do not delete any text that is already entered there, and instead move the caret to the end. Then press Space and paste the copied text here. Once done, click "Save and Apply" and close this window.
  12. Select Forge as the chosen version, click "Play", and enjoy playing with the new module-based Forge for 1.17 and with mods. You may or may not trust me, but it works, see: Proof

Note: The FML internals are not solid yet, and the Forge team is still figuring out how to make them as good as possible, so a breaking change may be introduced at some point and this workaround may stop working, so please keep it in mind.

Kron4ek commented 2 years ago

Thank you for the thorough investigation, it helped me a lot. I uploaded a new release and the issue should be fixed now.

Feel free to reopen if the issue is still present in the new release.

Tratnic commented 2 years ago

I should thank YOU for continuously developing this project. Now it works like a charm with the new Forge.

Just a nitpick, now usually two or more whitespace characters are used for separation, see: Excessive_whitespaces

Kron4ek commented 2 years ago

Yep, i saw these chaotic spaces too afterwards, but was too lazy to remove them. Maybe someday later :)