LiteLoader compile fails under Linux
Building under Linux fails with an error message:
FAILURE: Build failed with an exception.
Where: Build file '/server/home/gbl/SoftwareProjects/MyProjects/MinecraftMods/LiteLoader/build.gradle' line: 271
-
What went wrong: A problem occurred evaluating root project 'LiteLoader'.
Ambiguous method overloading for method java.io.File#. Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [class java.lang.String] [class java.net.URI]
This is in the definition of the deploy task, which says
def libraryDir = new File(new File(System.env.APPDATA), ".minecraft/libraries")
Under Linux, there is no APPDATA environment variable, which results in the null argument to new File, which results in this error.
Since, in Linux, the .minecraft directory gets created in the user's home directory, this should fix it (it definitely works for me):
def libraryDir = new File(new File(System.env.APPDATA == null ? System.env.HOME : System.env.APPDATA), ".minecraft/libraries")
-
LiteLoader sources are provided for instruction only, if they don't compile on your system I can only apologise but there is no general guarantee that the project will compile on any platform other than those upon which it is built. Bear in mind that if you're wishing to build mods for LiteLoader there is no need to compile it, you can simply leverage ForgeGradle to build projects, see the ExampleMod here on the gitlab.