FAQ

Here are some frequently asked questions about using Javelit. If you can't find any answer to your question here, please open an issueor open a discussion thread in the Github project.

How can I update the javelit CLI to the latest versionexpand_more
jbang app install --fresh --force javelit@javelit
How can I install a specific version of the javelit CLIexpand_more
jbang app install --force io.javelit:javelit:0.76.0:all@fatjar
How can I run Javelit on a subpath, behind a proxy ?expand_more

Javelit expects to be served at the root "/" of a domain. This is important for the websocket, media and page urls. If Javelit is served behind a proxy on a sub-path, for instance example.com/behind/proxy:

  • if the proxy sets the X-Forwarded-Prefix header, Javelit will work with no additional configuration
  • if the header above is not set, you need to pass the --base-path flag manually:
    • Standalone, in Javelit CLI: javelit run --base-path=/behind/proxy ....
    • Embedded, programmatically: Server.builder(...).basePath("/behind/proxy").build().

If --base-path is set and you need to access the app on localhost directly (not behind the proxy) pass the ?ignoreBasePath=true query parameter.
Example: localhost:8080/?ignoreBasePath=true. In dev mode, the browser automatically opens with ?ignoreBasePath=true.

How can I customize the CSS? How can I use a custom theme? What about dark mode?expand_more

Dark mode - as in switching between light and dark mode - is not supported yet.
You can pass your own custom theme as an .html file through custom headers.

javelit run --headers-file custom_theme.html YourApp.java

Or embedded:

Server.builder(....).headersFile(<Path to custom_theme.html>).build().start();

You can find example of custom themes in this folder. If you wish to make an LLM generate a custom theme, provide the original theme as input.

For more info, join the discussion in this thread.

forum

Still have questions?

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