Litematica

Litematica

8M Downloads

Cannot build on MacOS

mfnalex opened this issue ยท 10 comments

commented

Hi, I get the following message when trying to build the project using intelliJ on macOS:

23:29:25: Executing task 'build'...


> Configure project :
This mapping 'stable_39' was designed for MC 1.12! Use at your own peril.

> Task :extractMcpMappings
> Task :deobfCompileDeobfDepTask0 SKIPPED
> Task :deobfCompileRemapDepSourcesTask1 SKIPPED
> Task :liteloaderDeobfCompileDeobfDepTask0 SKIPPED
> Task :liteloaderDeobfCompileDeobfDepTask1 SKIPPED
> Task :liteloaderDeobfCompileRemapDepSourcesTask2 SKIPPED
> Task :liteloaderDeobfCompileRemapDepSourcesTask3 SKIPPED
> Task :deobfCompileDummyTask
> Task :deobfProvidedDummyTask
> Task :getVersionJson
> Task :downloadClient SKIPPED
> Task :extractDependencyATs SKIPPED
> Task :extractMcpData SKIPPED
> Task :genSrgs SKIPPED
> Task :deobfMcMCP SKIPPED
> Task :sourceApiJava
> Task :compileApiJava NO-SOURCE
> Task :processApiResources NO-SOURCE
> Task :apiClasses UP-TO-DATE
> Task :sourceMainJava

> Task :compileJava
Note: SpongePowered MIXIN Annotation Processor Version=0.7.4
Note: ObfuscationServiceMCP supports type: "searge"
Note: ObfuscationServiceMCP supports type: "notch"
Note: Loading searge mappings from /Users/alex/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_stable/39/1.12.2/srgs/mcp-srg.srg
Note: Loading notch mappings from /Users/alex/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_stable/39/1.12.2/srgs/mcp-notch.srg
error: cannot access ContainerLocalRenderInformation
  bad class file: /Users/alex/.gradle/caches/minecraft/net/minecraft/minecraft/1.12.2/stable/39/minecraftBin-1.12.2.jar(/net/minecraft/client/renderer/RenderGlobal$ContainerLocalRenderInformation.class)
    bad RuntimeInvisibleParameterAnnotations attribute: ContainerLocalRenderInformation(RenderChunk,EnumFacing,int)
    Please remove or make sure it appears in the correct subdirectory of the classpath.
Note: Writing refmap to /Users/alex/IdeaProjects/litematica/build/tmp/compileJava/compileJava-refmap.json
Note: Writing searge output SRGs to /Users/alex/IdeaProjects/litematica/build/tmp/compileJava/mcp-srg.srg
Note: Writing notch output SRGs to /Users/alex/IdeaProjects/litematica/build/tmp/compileJava/mcp-notch.srg
error: cannot access ContainerLocalRenderInformation
  bad class file: /Users/alex/.gradle/caches/minecraft/net/minecraft/minecraft/1.12.2/stable/39/minecraftBin-1.12.2.jar(/net/minecraft/client/renderer/RenderGlobal$ContainerLocalRenderInformation.class)
    bad RuntimeInvisibleParameterAnnotations attribute: ContainerLocalRenderInformation(RenderChunk,EnumFacing,int)
    Please remove or make sure it appears in the correct subdirectory of the classpath.
Note: Writing refmap to /Users/alex/IdeaProjects/litematica/build/tmp/compileJava/compileJava-refmap.json
Note: Writing searge output SRGs to /Users/alex/IdeaProjects/litematica/build/tmp/compileJava/mcp-srg.srg
Note: Writing notch output SRGs to /Users/alex/IdeaProjects/litematica/build/tmp/compileJava/mcp-notch.srg
2 errors

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 16s
7 actionable tasks: 7 executed
23:29:42: Task execution finished 'build'.

commented

You can find here the lastest build for litematica for 1.12.2 https://masa.dy.fi/mcmods/client_mods/?mcver=1.12.2

commented

I believe the above error message specifically happens in the 1.12.x dev environments if you don't run ./gradlew setupDecompWorkspace first once. (And you would probably also want to run the ./gradlew eclipse task as well, or maybe the ./gradlew genIntellijRuns task if you use IDEA, although personally I set it up via the eclipse task even in IDEA, because I want to avoid any and all gradle dependencies and tasks while running via the IDE.)

(And when you are making builds, I would do it from the command line, although I guess it shouldn't matter that much even if you run the build task via an IDE... just feels weird to me.)

And unless you actually make some changes yourself, I'd recommend getting the ready made builds from the above link. Also note that there are very large refactors in progress in malilib that affect all the other mods as well, and currently Litematica is the only mod that hasn't yet been updated to all those changes.

commented

I tried to run ./gradlew setupDecompWorkspace but it also fails:

LapMacBookTop:litematica alex$ ./gradlew setupDecompWorkspace
> Configure project :
This mapping 'stable_39' was designed for MC 1.12! Use at your own peril.

> Task :recompileMc FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':recompileMc'.
> java.lang.NullPointerException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 11s
4 actionable tasks: 4 executed

I need to compile it myself because I want to do some changes to the source code

commented

Using --stacktrace yields this:

LapMacBookTop:litematica alex$ ./gradlew setupDecompWorkspace --stacktrace

> Configure project :
This mapping 'stable_39' was designed for MC 1.12! Use at your own peril.

> Task :recompileMc FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':recompileMc'.
> java.lang.NullPointerException (no error message)

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':recompileMc'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:262)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:246)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:136)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:201)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.executeWithTask(DefaultTaskPlanExecutor.java:192)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.NullPointerException
        at net.minecraftforge.gradle.user.TaskRecompileMc.getExtPath(TaskRecompileMc.java:107)
        at net.minecraftforge.gradle.user.TaskRecompileMc.doStuff(TaskRecompileMc.java:82)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:794)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:761)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
        ... 30 more


* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 9s
4 actionable tasks: 4 executed

Help please :(

commented

What Java version do you have installed? You need to be using a Java 8 JDK for 1.12.x development I'm pretty sure, I don't think Java 9+ will work. I'm also not sure if newer Gradle versions will work, so I'd stick to the 2.14.1 that the wrapper is by default set to in my 1.12 projects.

commented
LapMacBookTop:~ alex$ java -version
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

Do I really need to use Java 8? I thought Java is backward compatible :/

EDIT: I'd like to build Litematica for 1.16.x. Which branch should I use?
Thanks for your help! ๐Ÿ‘ :)

commented

Oh if you want to build the Fabric versions then you should be fine with any Java version 8+. It's just the 1.12 tool chain that assumes some Java internals that changed in Java 9, or something.

So for 1.16.x currently use the fabric_1.16_temp_features branch, it has a bunch of temporarily ported things from 1.12.2 and some fixes and temporary features that will later be replaced or come via updates from the main branch from the earlier MC versions.
And for the Fabric version you don't use the same Gradle setup command either than in 1.12. So to get the dev environment going for the Fabric versions, run ./gradlew genSources eclipse. And then to build the mod it's the same ./gradlew build command still.

commented

Oh I am sorry for the trouble, it was late and night, I will try again with the temp_features branch :)

commented

Building now works perfectly, thanks :)

commented

hey im confused on how to change all of this i am new to modding and this is my error code: * What went wrong:
Execution failed for task ':recompileMc'.

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files (x86)\Java\jre1.8.0_291"

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 12s
4 actionable tasks: 4 executed
if anyone can help me and walk me through all the steps taht would be greatly appreciated! i am using command called : gradlew setupDecompWorkspace. I dont know how to change my irectory from JRE To JDK