RKB00013 Command line arguments - Glease/RKB GitHub Wiki

Command line arguments used by Forge

Well in fact forge does use a few command line args. However whenever its doc (or someone else) say it uses some command line args, it means system properties specified at command line. You don't need any fiddling with these command line arguments, unless you are making a new launcher.

--modListFile

Description: Specify a mod list file. If it has a prefix of absolute:, it will be parsed as absolute path. Otherwise it will be resolved against minecraft directory, which is either specified at --gameDir or just current working directory. This doesn't include the default mods/mod_list.json and mods/@MC_VERSION@/mod_list.json. Default: none

--mods

Description: A comma separated list of mod file paths. They will have to be resolved against current working directory. Default: none

Command line arguments used by Launchwrapper

This section will be useful only to launcher developers, and it applies to vanilla minecraft, too.

WIP and there is no plan to complete it.


Difference between command line arguments and system properties specified at command line

Let's take this command as an example:

java -Xmx64m -Dfoo.bar=blitz -jar echo.jar Hello world!

Well with enough programming experience you can infer what it does. Just a hello world.

In this command,

-Xmx64m is a JVM flag, which is not visible from a application's view (unless you use javax.management.*). It specifies the max heap size is 64 megabytes, which should be enough for a simple echo program.

-Dfoo.bar=blitz is a system property. It can be retrieved through System.getProperty(). If it's boolean, long or integer, it can also be retreived through Integer.getInteger(), Long.getLong() or Boolean.getBoolean() (another nonsense of early Java design). In this example you can retrieve its value through System.getProperty("foo.bar"), which will yield "blitz"

Hello world are command line arguments, which will be parsed into {"Hello", "world"} and passed to your main method. Forge mods can see this only through ITweaker.acceptOptions() and Launch.blackboard.get("launchArgs"), and normally, if not in any cases, you don't need this.


Public domain. This doesn't worth copyrighting.