0

I'm trying to learn how to program with Java using Eclipse. For this I'm trying to do a Minecraft mod project since I'm actually a gameplay programmer. I just recorded a video to show you what are my problems:

Here

Maybe some of you will see the problem I have. Thank you very much and have a good day :)

PS: I can edit and add some code if It's gonna help.

  • I only got a brief look at your build.gradle file in the video. Would you please post the file here? Also, please post the settings.gradle file if you have one. Also, my first debugging step when gradle is involved is running gradle clean cleanEclipse eclipse build. This removes all previously compiled classes, removes all the gradle-generated files for Eclipse (like .classpath and .project), rebuilds said files, and rebuilds your project. Just a good way to make sure you have a clean slate! – BRasmussen Feb 23 '16 at 18:22
  • I don't have any settings.gradle file, only have some gradle wrapper properties in my forge library. Also I tried to add the -clean into the eclipse.ini to clean the cache like you said, restarted eclipse and tried again without sucess. Here is the code in build.gradle: http://pastebin.com/5ZD78RyC – Alexandre Blanchet Feb 23 '16 at 20:01
  • Hmm... The error at 2:58 said that it cannot find a main method. Where is your GradleStart class located? The New_Configuration.launch is for Eclipse runtime and the Jar would not understand where the GradleStart class is. – BRasmussen Feb 23 '16 at 22:14
  • GradleStart was in forge, folder build/tmp/makeStart. I tried to copy it into my project without sucess. – Alexandre Blanchet Feb 24 '16 at 04:18

1 Answers1

0

I am increasingly convinced that you need to add a MANIFEST.MF to a META-INF/ folder in your project. The issue being stated is that Java cannot find a Main class after the jar has been built, though we have seen that the application can run when Eclipse starts it (and Eclipse was told where the main class was.)

I would start here and begin gathering information on how to build a manifest file that will include the information you need.

Use of the MANIFEST.MF file in Java

I will be busy for the next couple of days, but will try and keep an eye here if you have follow-up questions.

Edit: Some more information after reviewing your video. Does your Naruto project rely on the forge project, or does the forge project rely on the Naruto project? If I am understanding this correctly, I think your build.gradle file needs to list forge as a dependency

compile project (":forge")

the ":forge" part indicates that forge is in the same directory structure as the Naruto project. You can then rely on Gradle to create the jar for you. Gradle is an amazing tool and, when possible, you should leverage Gradle in your development (since you have it built into your project already.) You can also tell Gradle to generate a MANIFEST.mf file when it creates the jar. See this link for creating a jar / manifest with Gradle.

http://www.mkyong.com/gradle/gradle-create-a-jar-file-with-dependencies/

Community
  • 1
  • 1
BRasmussen
  • 350
  • 2
  • 15