gurkenlabs / litiengine

LITIENGINE 🕹 The pure 2D java game engine.
https://litiengine.com/
MIT License
725 stars 93 forks source link

No main manifest attribute in utiliti.jar #434

Closed Gamebuster19901 closed 2 years ago

Gamebuster19901 commented 2 years ago

Describe the bug The MAINIFEST.MF is missing the main class definition in utiliti.jar.

Stack Trace The error message you get either in your console or the crash.txt located in your program's root directory.

gamebuster@gamebuster-Ryzen9-3900X-RTX-3080:~/Desktop/Modding/litiengine/build/litiengine-utiliti/libs$ java -jar litiengine-utiliti-0.5.2-beta-SNAPSHOT.jar
no main manifest attribute, in litiengine-utiliti-0.5.2-beta-SNAPSHOT.jar

To Reproduce Steps to reproduce the behavior:

  1. Build the project
  2. Run the Utiliti jar

Expected behavior A main class definition is included, so the program can launch.

Screenshots N/A

Your System: N/A

Additional context N/A

weisJ commented 2 years ago

Even if there were a Main-Class attribute in the jars manifest it wouldn’t start as utiliti.jar isn't fat (i.e. bundle it's dependencies). To start the program you should create an executable image using gradlew jpackage. Then the resulting program will be located in build/litiengine-utiliti/jpackage/litiengine-utiliti. Dependending on the operating system the file can be in different places.

Gamebuster19901 commented 2 years ago

Ah, we should include build instructions. Or we could make the build task finalizedBy jpackage

steffen-wilke commented 2 years ago

Since I'm currently bundling the "SDK" for the v0.5.2-beta release: I think an automated way to create the distribution binaries with jpackage on all supported platforms (win, linux and ios) would be something to look into in the near future.

(Just for context: currently fighting with a local Hyper-V to get everything building properly on Linux and also: I don't have a Mac 😐)

weisJ commented 2 years ago

It should be possible to build all distributions using github actions. I can create a PR for that if desired :)

steffen-wilke commented 2 years ago

Well, that would be perfect 👍

Just a heads-up: I'm currently fighting with jpackage and it seems like there are even bugs that are only fixed in JDK 17... Also, one of the errors I'm running into is:

Error: Option [--linux-package-name] is not valid with type [app-image]

For now, I think we'll do a release for Windows first and Linux/MacOS should follow in the upcoming days. After all, we promised a new engine release this year, and for that we're running out of time :smile:

@nightm4re94 fyi