简体   繁体   中英

Can't export java project with a working run configuration using Eclipse/Gradle

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 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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM