TotalFreedom / TotalFreedomMod

A server modification for the TotalFreedom server
http://totalfreedom.me/
Other
43 stars 222 forks source link

Issue building TFM #2147

Closed ghost closed 6 years ago

ghost commented 6 years ago

I get these errors when I try to build TFM. Any solutions to resolve this issue?


COMPILATION ERROR :

me/totalfreedom/totalfreedommod/admin/AdminList.java:[53,9] cannot access java.util.function.Function class file for java.util.function.Function not found me/totalfreedom/totalfreedommod/admin/AdminList.java:[54,13] method does not override or implement a method from a supertype 2 errors


BUILD FAILURE

Total time: 18.518s Finished at: Mon Jan 08 18:16:12 GMT 2018 Final Memory: 21M/238M

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project totalfreedom: Compilation failure: Compilation failure: me/totalfreedom/totalfreedommod/admin/AdminList.java:[53,9] cannot access java.util.function.Function class file for java.util.function.Function not found me/totalfreedom/totalfreedommod/admin/AdminList.java:[54,13] method does not override or implement a method from a supertype [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Wild1145 commented 6 years ago

What branch are you trying to build?

ghost commented 6 years ago

The branch i'm using is TFM1.12-Alpha

Wild1145 commented 6 years ago

Have you made any changes to the code?

ghost commented 6 years ago

No. All I did was clone TFM and add the lib folder. No errors appear after compiling, but the error above for some reason keeps showing and failing to build when I build the plugin.

JeromSar commented 6 years ago

What version of Java are you building with? We recommend at least JDK 1.7

Wild1145 commented 6 years ago

@poppy44 The alpha branch contains fully automated maven building. Try running a clean & build instead of just a build, if not re-clone it and DO NOT add the lib folder this time, just launch the project and compile it with maven.

ghost commented 6 years ago

I'm using JDK version 1.7.0_80

ghost commented 6 years ago

oh Wild I forgot to mention. When I was building it, I was selecting clean and build the whole time.

ghost commented 6 years ago

@Wild1145 how do I compile it with maven? when I cloned TFM from git, it also came with the lib folder.

JeromSar commented 6 years ago

I see the issue. Whilst TotalFreedomMod should be compiled with JDK 1.7 (as indicated in pom.xml), it actually uses JDK 8 functionality (namely java.util.function.Function). This is a bug, but there's no fix right now. For now, I recommend upgrading to JDK 8.

ghost commented 6 years ago

It works now, seems the older version of JDK I used was causing it to fail at building. Thanks for the help. :)