Run your Jeamlit app

Working with Jeamlit is simple. First you sprinkle a few Jeamlit commands into a normal Java class, and then you run it. We list few ways to run your app, depending on your use case.

Once you've created your Java class, say MyApp.java, the easiest way to run it is with jeamlit run:

jeamlit run MyApp.java

As soon as you run the script as shown above, a local Jeamlit server will spin up and your app will open in a new tab in your default web browser.

You can also pass a URL to jeamlit run! This is great when your script is hosted remotely, such as a GitHub Gist. For example:

jeamlit run https://raw.githubusercontent.com/jeamlit/jeamlit/main/examples/getting_started/App.java

You can also pass a GitHub folder! This is especially handy for multipage apps.

jeamlit run https://github.com/jeamlit/jeamlit/tree/main/examples/multipage_ai

For a folder, the convention to find the app entrypoint is the following:

  • if there is a single .java file at the root of the folder (other pages are put in a subfolder), this file is the entrypoint
  • if a file named App.java is present, it is the entrypoint
  • if a file named Main.java is present, it is the entrypoint
  • an error is thrown

You can embed Jeamlit in your existing Java project. See quick installation and jeamlit embedded details.

forum

Still have questions?

Go to our discussions forum for helpful information and advice from Jeamlit experts.