Minecraft Forge 1.7.2/1.7.10 Setting up Java for Modding

Background

Java is sometimes difficult to set up properly, because there are run-time environments (JRE) and Java development kits (JDK) and furthermore you need the right versions and need to set up proper Windows environment variable paths.

Steps To Set Up Java For Modding

    1. Download an appropriate JDK (not JRE!). At time of writing the Kit 7 was most compatible with modding, downloadable from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html.  Make sure you choose the version appropriate to your computer (in my case Windows x64).
    2. Install the JDK following the instructions.
    3. Ensure the Windows path variables are set up.  You probably need to create a JAVA_HOME system variable, as follows


    Find JDK Installation Directory
    First you need to know the installation path for the Java Development Kit.
    Open the default installation path for the Java Development Kit
    C:\Program Files\Java
    There should be a subdirectory like
    C:\Program Files\Java\jdk1.6.0_10
    Set the JAVA_HOME Variable
    Once you have the JDK installation path:
      1. Right-click the My Computer icon on
      2. your desktop and select Properties.
      3. Click the Advanced tab. Click the
      4. Environment Variables button. Under System Variables, click New.
      5. Enter the variable name as JAVA_HOME.
      6. Enter the variable value as the installation path for the Java Development Kit.
      7. Click OK.
      8. Click Apply Changes.
    You need to restart windows.
    4. Add to the Path system variable (and for good measure create PATH system variable) using similar method to above but add to existing path using semi-colon separator and then putting the path to the \bin folder inside the path you used for JAVA_HOME.

    3 comments:

    1. what do u mean "add" to the Path variable? i have my Path set up as a user variable, does that matter?

      ReplyDelete
      Replies
      1. Well Windows should already have an Environnment Variable called PATH which you can add to (using semicolon to separate from what is already there). I think it is also true that you can set up your development environment to look for the path instead but I tend to do it right in the Windows Environment Variables.

        Delete