4

I'm trying to have my Minecraft appdata folder on a different partition (from now on referred to as D:). This is what should be where:

D:
    Steam
    Minecraft
        .minecraft

This is my batch file:

@ECHO OFF
SET APPDATA= D:\Minecraft
CD /D %~dp0
java -jar minecraft.jar

It's supposed to set the %APPDATA% folder (where Minecraft stores its data) to D:\Minecraft, go there, and launch the minecraft.jar downloaded from minecraft.net. However, when I run it, I get the following error:

Exception in thread "main" net.minecraft.bootstrap.FatalBootstrapError: Unable to create directory:  D:\Minecraft\.minecraft  
        at net.minecraft.bootstrap.Bootstrap.main(Bootstrap.java:369)

What am I doing wrong? Have the steps for making Minecraft portable in 1.6.2 differed?

1
  • You need to launch the launcher. With it, you don't even need to worry about changing the directory, as it'll be done for you (if you set it up right).
    – user48430
    Commented Sep 7, 2013 at 14:26

1 Answer 1

3

The Minecraft jar file now has new, very different start logic. It can no longer be launched just by launching the jar file, and requires a huge pile of switches passed to it by the launcher to start, many of them communicating various non-optional settings from the new Profile feature, and I believe some code signing stuff as well. As far as I know, no-one has yet figured out what exactly needs to be passed to it so that it will happily start without using the launcher.

Fortunately, it's very easy to bypass that problem by simply having your script's last line launch the launcher, which will then happily believe that the AppData directory is actually D:\Minecraft or whatever your batch file sets it to. I've been doing this since before the 1.6-series launcher debuted (to keep multiple family members' accounts separate), and it has continued to work flawlessly with the new launcher.

3
  • "It can no longer be launched just by launching the jar file, and requires a huge pile of switches passed to it by the launcher to start..." Having looked at the way 1.6 launches, I have to disagree with you. You just have to kick on the main method in the jar and pass it everything it needs or should know. It's more complex, but not as complex as you make it sound. The only thing I'm not sure about are dependencies.
    – Bobby
    Commented Sep 7, 2013 at 10:28
  • @Bobby Looking at the Minecraft Launcher's raw output will give you an idea of the arguments needed for launching the .jar file.
    – Timtech
    Commented Sep 7, 2013 at 12:17
  • @Timtech The launcher also unpacks some files from the jar every startup with what appears to be a session ID attached to them. Unless that is replicated exactly, it won't start. I'd forgotten about that detail, but it contributed to my impression that a command-line start without the launcher has yet to be discovered. Commented Sep 7, 2013 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.