X

Geertjan's Blog

  • April 25, 2015

Seamless Minecraft Forge in NetBeans

Geertjan Wielenga
Product Manager

Minecraft Forge is a common open source API focused on allowing mods to be created without the need for the source code of Minecraft to be edited. 

Happy to report that Minecraft Forge works seamlessly in NetBeans IDE. Take the following steps:

  1. Download and unzip Forge 1.8 from http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.8-11.14.1.1341/forge-1.8-11.14.1.1341-src.zip

  2. In the folder where you unzipped the above, run "gradlew setupDecompWorkspace --refresh-dependencies".

  3. Start NetBeans IDE (I am using NetBeans IDE 8.0.2). Go to Tools | Plugins and install "Gradle Support".

  4. Go to File | Open Project. Browse to the folder where you unzipped the above, which will now be recognized as a Gradle project. Open the project. Wait a moment for the Gradle plugin in NetBeans IDE to figure out the structure of the Gradle project you have opened.

  5. Right-click the Gradle project and go to Tasks | run | runClient. After a moment, Minecraft starts up!

Illustrative screenshot, click to enlarge it:

Next, you'll want to map the "runClient" task to the "Run Project" command in NetBeans IDE, so that running your mods is as simple as pressing F6. Right-click the project and choose Properties. The Project Properties dialog opens:

Click "Manage Built-In Tasks" above. Now look for "Run" and then type "runClient" in the Tasks field, as shown below:

Click OK. Press F6 (which is mapped by default to "Run Project") and the "runClient" task will be run! 

Congratulations to Attila Kelemen from Hungary, for making such a nice NetBeans plugin for Gradle. 

Now mod away

Join the discussion

Comments ( 2 )
  • guest Friday, May 1, 2015

    Thanks so much, i was looking for a while for a guide that shows how yo use NetBeans in modding minecraft.

    Thanks a bunch


  • guest Wednesday, December 9, 2015

    When I attempt to runClient I have a build failure and a stacktrace returns this:

    Issue 1

    --------

    Requested project: /home/user/.minecraftmod

    Stack trace:

    org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.7-bin.zip'.

    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:57)

    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)

    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)

    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)

    at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:71)

    at org.netbeans.gradle.project.tasks.AsyncGradleTask.runBuild(AsyncGradleTask.java:322)

    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgressIgnoreTaskDefCancel(AsyncGradleTask.java:427)

    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgressIgnoreTaskDefCancel(AsyncGradleTask.java:354)

    at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgress(AsyncGradleTask.java:346)

    at org.netbeans.gradle.project.tasks.AsyncGradleTask.access$400(AsyncGradleTask.java:76)

    at org.netbeans.gradle.project.tasks.AsyncGradleTask$BuildExecutionItem$1.run(AsyncGradleTask.java:697)

    at org.netbeans.gradle.project.tasks.GradleDaemonManager.runBlockingGradleTask(GradleDaemonManager.java:52)

    at org.netbeans.gradle.project.tasks.GradleDaemonManager.access$200(GradleDaemonManager.java:23)

    at org.netbeans.gradle.project.tasks.GradleDaemonManager$2.execute(GradleDaemonManager.java:129)

    at org.jtrim.concurrent.AbstractTaskExecutorService$FunctionWrapper.execute(AbstractTaskExecutorService.java:270)

    at org.jtrim.concurrent.AbstractTaskExecutorService$TaskOfAbstractExecutor.execute(AbstractTaskExecutorService.java:340)

    at org.jtrim.concurrent.Tasks$RunOnceCancelableTask.execute(Tasks.java:342)

    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$QueuedItem.runTask(ThreadPoolTaskExecutor.java:1213)

    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.executeTask(ThreadPoolTaskExecutor.java:1049)

    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.run(ThreadPoolTaskExecutor.java:1179)

    at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker$1.run(ThreadPoolTaskExecutor.java:998)

    at java.lang.Thread.run(Thread.java:745)

    Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':runClient'.

    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)

    at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)

    at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)

    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:102)

    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:94)

    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)

    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)

    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:94)

    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)

    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)

    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)

    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)

    at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)

    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)

    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)

    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)

    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:77)

    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:47)

    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)

    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)

    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)

    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)

    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)

    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)

    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)

    at org.gradle.util.Swapper.swap(Swapper.java:38)

    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)

    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

    at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)

    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)

    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)

    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:71)

    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)

    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

    at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)

    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)

    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)

    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)

    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)

    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)

    Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':runClient'.

    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)

    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)

    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)

    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)

    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)

    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)

    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)

    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)

    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)

    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)

    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)

    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:62)

    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)

    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)

    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)

    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)

    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)

    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)

    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)

    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)

    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)

    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)

    at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:155)

    at org.gradle.internal.Factories$1.create(Factories.java:22)

    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)

    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)

    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:152)

    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:33)

    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:100)

    ... 42 more

    Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/usr/lib/jvm/java-8-oracle/bin/java''

    at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:197)

    at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:327)

    at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)

    ... 2 more

    Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/usr/lib/jvm/java-8-oracle/bin/java'

    at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)

    at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)

    at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:68)

    ... 2 more

    Caused by: java.io.IOException: Cannot run program "/usr/lib/jvm/java-8-oracle/bin/java" (in directory "/home/user/.minecraftmod/run"): error=2, No such file or directory

    at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)

    ... 4 more

    Caused by: java.io.IOException: error=2, No such file or directory

    ... 5 more


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.