Add example of starting application via java -jar

Open
#328 8 comments 0 reactions 1 assignee View on GitHub

@m-reza-rahman is already working on this.

Since Aug 21, 2024.

Assessment

This issue has not been assessed yet.

Description

enhancement low-priority

I'd love to see an option to start a project with an embedded runtime, and have it package a single jar.

Possibly by using SeBootstrap and an SeContainer, something like:

SeContainer container = SeContainerInitializer.newInstance()
  .addPackages(true, ExampleApplication.class)
  .initialize();

ExampleApplication app = new ExampleApplication();
SeBootstrap.start(app, SeBootstrap.Configuration.builder().port(8080).build())
  .thenAccept(instance -> instance.stopOnShutdown(stopResult -> container.close()));
URI uri = UriBuilder.fromUri("http://localhost/").port(8080).build();

System.out.printf("Application started: %s%nStop the application using CTRL+C%n", uri.toString());
Dominant language
HTML
Stars
61
Forks
51
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-ee4j/starter

All issues in eclipse-ee4j/starter

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.