With the new Gradle integrated Forge source, comes a new way to setting up your workspace. In this tutorial I will be explaining how you can set up the Eclipse workspace and necessary dependencies to be able to start modding.
This tutorial will be for the advanced version, which means you can make lots of different mods in one Eclipse workspace. Seems good? Let’s start.
First of all, you need to get JDK, Java Development Kit. You might be saying “Hey EMX, I already have Java, that’s what I use to play Minecraft!” Well, JDK and JRE are different. JDK is Java too, but added with stuff to help you develop your Java apps. To get Java Development Kit, you can go here. Download the corresponding version to your computer, and then install it.
After installing that, you need to set your environment variables. To do this, go to Control Panel -> System and Security -> System, and on the sidebar select Advanced system settings. It will open a new window. Click on Environment Variables, and on the System variables box, i.e. the bottom one, add two new variables:
- PATH :: C:\Program Files\Java\jdkx.x.x_xx\bin
- JAVA_HOME :: C:\Progra~1\Java\jdkx.x.x_xx
If you already have your PATH variable, and it is not empty, you can add a semicolon (;), and then the new value.
All done? Great. Now, you can download Eclipse. Eclipse is an IDE, which stands for Integrated Development Environment, which will aid in coding your mod. You can download Eclipse here. Eclipse is released as a package, not an installer, so just extract it to a new folder, and you’re done. You should be left with an “eclipse” folder inside your root modding folder.
Okay, now you need to download Forge itself. Download Forge SRC version (or MDK for newer versions) right here. You always want to get the latest version for modding. Extract this archive to a new folder in the modding folder you created earlier. For clarity I will be naming mine “forge” for this tutorial, so now inside your modding folder, you have two folders, eclipse and forge.
Inside the forge folder, hold shift and right click on the background, and select “Open command window here”. A command prompt will appear, enter the following:
gradlew.bat setupDecompWorkspace eclipse
This is a fairly long process, you’ll want to wait for a few minutes until the command terminates and “BUILD SUCCESSFUL” is shown in the command window.
When done, you can go out of your forge folder into your modding folder, and make a new folder called “workspace”. This will be the folder where you store your mod code.
Okay, from here onwards, we will work in Eclipse IDE, so open that. You will be prompted for the workspace directory, so browse for the “workspace” folder we created before. Eclipse will open, you can close the welcome screen. Click on File -> Import, and select “Existing projects into workspace”. In the “Select root directory” input, browse for the “forge” folder. Enter that, and in “projects” you should see a new project. Select that, and click finish.
Congratulations! You have the dirty work done, and now you can finally start forge modding!
For clarification purposes, I will give you my file system tree:
Forge Modding (main modding folder) │───eclipse (downloaded from Eclipse site) │ ├───eclipse.exe │ └───Other eclipse files ├───forge (contains downloaded forge data)│ ├───gradlew.bat │ └───Other forge files └───workspace (your eclipse workspace)