HOW-TO: Run Forge portably with a custom Java version
by mtgrares
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
2 posts
• Page 1 of 1
HOW-TO: Run Forge portably with a custom Java version
by Agetian » 19 Nov 2012, 06:11
Did you ever want to...
1) Run Forge portably, even from a flash drive, and even on computers that do not have Java installed on them at all?
2) Upgrade to Java 7 but still be safe that you're running Forge with the Java 6 runtime while we are working on figuring out whether Forge is fully compatible with JRE 7 already or if is still needs some code base upgrades?
Well, actually, both are very simple to do and involve a rather simple procedure that is described here in this topic. This example is written for Microsoft Windows, but I'm quite sure that a similar shell script can be written under Linux or Mac OS X as well if necessary (though your personal experiences in this area, as well as advice, are all welcome!).
So, here's how you create a fully portable installation of Forge with its own, independent version of Java:
1) Install the Java Runtime Environment that you want to make portable (for instance, if you want to run Forge with Java 6u37, then install JRE 6u37 on your computer first).
2) In your Forge folder, create a new folder and call it "jre".
3) Copy all the Java Runtime Environment files from wherever you installed JRE into the "jre" folder you just created for Forge. You need to preserve the structure of folders, so that for the "jre" folder, you have a structure like this:
IMPORTANT: the allocation of 1 GB memory for Forge seems to be enough (I've never had issues with that), but if you ever run into memory problems, you may want to allocate more memory for Forge; in that case, try specifying, for example, -Xmx1280m instead of -Xmx1024m as a parameter in the batch file. Personally I've never had a problem with allocating 1024MB. If you specify a parameter that is more than Java can allocate on your computer, it will fail to run, so it's recommended that you try the original -Xmx1024m parameter first before trying to increase it.
5) Save your batch file and launch it instead of launching Forge.exe. Enjoy your portable installation of Forge!
Once you make your Forge portable like that, it becomes independent of the main Java runtime installed on your PC. You can freely upgrade, for example, to Java 7, while still running Forge with the original Java 6 runtime that you copied into your "jre" folder. If you want to upgrade your Java runtime you're running with Forge, just delete the current contents of "jre" and copy the newer, updated version of JRE into it in the same way as described in step 3 above.
Enjoy!
- Agetian
1) Run Forge portably, even from a flash drive, and even on computers that do not have Java installed on them at all?
2) Upgrade to Java 7 but still be safe that you're running Forge with the Java 6 runtime while we are working on figuring out whether Forge is fully compatible with JRE 7 already or if is still needs some code base upgrades?
Well, actually, both are very simple to do and involve a rather simple procedure that is described here in this topic. This example is written for Microsoft Windows, but I'm quite sure that a similar shell script can be written under Linux or Mac OS X as well if necessary (though your personal experiences in this area, as well as advice, are all welcome!).
So, here's how you create a fully portable installation of Forge with its own, independent version of Java:
1) Install the Java Runtime Environment that you want to make portable (for instance, if you want to run Forge with Java 6u37, then install JRE 6u37 on your computer first).
2) In your Forge folder, create a new folder and call it "jre".
3) Copy all the Java Runtime Environment files from wherever you installed JRE into the "jre" folder you just created for Forge. You need to preserve the structure of folders, so that for the "jre" folder, you have a structure like this:
- Code: Select all
jre/
....bin
....lib
....COPYRIGHT
....README.txt
....THIRDPARTYLICNSEREADME.txt
....Welcome.html
- Code: Select all
jre\bin\javaw.exe -Xmx1024m -jar forge-1.3.1-jar-with-dependencies.jar
IMPORTANT: the allocation of 1 GB memory for Forge seems to be enough (I've never had issues with that), but if you ever run into memory problems, you may want to allocate more memory for Forge; in that case, try specifying, for example, -Xmx1280m instead of -Xmx1024m as a parameter in the batch file. Personally I've never had a problem with allocating 1024MB. If you specify a parameter that is more than Java can allocate on your computer, it will fail to run, so it's recommended that you try the original -Xmx1024m parameter first before trying to increase it.
5) Save your batch file and launch it instead of launching Forge.exe. Enjoy your portable installation of Forge!
Once you make your Forge portable like that, it becomes independent of the main Java runtime installed on your PC. You can freely upgrade, for example, to Java 7, while still running Forge with the original Java 6 runtime that you copied into your "jre" folder. If you want to upgrade your Java runtime you're running with Forge, just delete the current contents of "jre" and copy the newer, updated version of JRE into it in the same way as described in step 3 above.
Enjoy!
- Agetian
- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: HOW-TO: Run Forge portably with a custom Java version
by ozks » 05 Feb 2013, 06:41
works fine. thanks
now, i don't need java to play it
now, i don't need java to play it
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 28 guests