tommybox

2025-12-07 0 747

? TommyBox

About:

TommyBox is a standalone executable container that makes it possible to launch static and dynamic web apps on a desktop by providing built-in server and browser functionality.

TommyBox is similar to Electron and NW.js.

An app can be provided as a directory or packed as WAR (or ZIP) archive that can contain JSP, servlets, and static stuff like CSS, JavaScript, etc.

Under the hood, TommyBox is built on top of Tommy web server and SWT browser widget.
App can be packed as WAR or ZIP archive and can optionally contain PWA manifest, JSP, servlets and all static stuff like CSS, JavaScript files etc.

See TommyBox in action: https://github.**com*/xnbox/tommybox_demo

Download:

Download the latest release of tb.jar

Features:

  • Single cross-platform executable jar (starts from ~25Mb)
  • No dependencies
  • No installation
  • No own configuration files, instead, TommyBox uses standard standard PWA webmanifest and standard Tomcat configuration files
  • Operating systems:

    • Linux
    • macOS
    • Windows
  • Architectures:

    • x86_64
    • win32-x86_64
    • aarch64
    • ppc64le
  • Supports custom command line args, stdin, stdout, stderr
  • Configurable display modes:

    • in-window
    • in-browser
    • fullscreen
    • headless
  • Single and multiple windows modes
  • Optional custom splash screen
  • Optional custom context menu
  • Optional custom system tray icon with custom menu

Supported web apps:

  • WAR files
  • Web apps packed as ZIP archives (including standard password-protected ZIPs)
  • Exploded web apps (local directories)
  • Remote WAR / ZIP files (on HTTP servers)
  • Embedded WAR / ZIP files and directories

Usage:

java -jar tb.jar [options] [custom arg]...

Options:
        --help               print help message
        --app <file|dir|URL> run app from ZIP or WAR archive, directory or URL
        --password <string>  provide password for encrypted ZIP or WAR archive

Run app:

Run ZIP (or WAR) file:

java -jar tb.jar --app MyKillerApp.war

Run ZIP (or WAR) file with custom command-line args:

java -jar tb.jar --app MyKillerApp.war myparam1 myparam2 ...

Run ZIP (or WAR) from web server:

java -jar tb.jar --app https://e*xample.c**om/MyKillerApp.zip

Run exploded web app from directory:

java -jar tb.jar --app MyKillerAppDir

Run password-protected ZIP (or WAR) archive:

java -jar tb.jar --app MyKillerApp.zip --password mysecret

Embed app:

  • Option 1. Copy your app content into the /app directory of the tb.jar.
  • Option 2. Pack your app as app.war or app.zip (the archive can be encrypted) and copy the archive to the root directory of the tb.jar.

Brand your app by renaming the tb.jar to the MyKillerApp.jar.

Run embedded app:

java -jar MyKillerApp.jar

Run embedded app with custom command-line args:

java -jar MyKillerApp.jar myparam1 myparam2 ...

Run password-protected embedded app:

java -jar MyKillerApp.jar --password mysecret

Run password-protected embedded app with custom command-line args:

java -jar MyKillerApp.jar --password mysecret myparam1 myparam2 ...

TommyBox specific PWA manifest keys:

Key Type Default value Description
display string standalone Standard PWA display mode.
Possible values:
standalone
minimal_ui
browser
fullscreen
minimized_window (non-standard)
maximized_window (non-standard)
desktop_area (non-standard)
headless (non-standard)
enable_fullscreen boolean true Allow fullscreen mode
tray_icon boolean true Tray icon
window_buttons array [\"minimize\", \"maximize\", \"close\"] Window buttons list.
Possible elements:
minimize
maximize
close
window_menu string none Window menu mode.
Possible values:
custom
native
none
window_always_on_top boolean false Always on top window property
window_size string null Window size as string Eg.: 640×480
window_x number null Window location X coordinate (in pixels)
window_y number null Window location Y coordinate (in pixels)
strings array [] I18N dictionary for custom strings

TommyBox specific URL protocols:

Protocol Description HTML Example
home: Home action <a href=\"home:\">Home</a>
back: Back action <a href=\"back:\">Back</a>
forward: Forward action <a href=\"forward:>Forward</a>
reload: Reload action <a href=\"reload:\">Reload</a>
quit: Exit to OS <a href=\"quit:\">Exit</a>
minimize: Minimize window <a href=\"minimize:\">Minimize</a>
fullscreen: Switch to fullscreen <a href=\"fullscreen:\">Fullscreen</a>
open: Open the given URL in OS <a href=\"open:file://home/john/my.pdf\">Open PDF</a>
open_in_new_window: Open the given URL in the new window <a href=\"open_in_new_window:http://**example.*com\">Open in New Window</a>
open_in_browser: Open the given URL in the browser <a href=\"open_in_browser:http://**example.*com\">Open in Browser</a>
java: Launch Java code <a href=\"java:javax.swing.JOptionPane.showMessageDialog(null, \\\"Hello, Java!\\\")\">Launch Java Code</a>
js: Launch JavaScript code <a href=\"js:javax.swing.JOptionPane.showMessageDialog(null, \'Hello, JavaScript!\')\">Launch JavaScript Code</a>

Access to the custom command-line args and system streams programmatically (JNDI):

// ...somewhere in your Servlet or JSP

InitialContext ctx = new InitialContext();

/* get custom command-line args */
String[] args = (String[]) ctx.lookup(\"java:comp/env/tommy/args\");

/* get standard input (stdin) */
InputStream stdin = (InputStream) ctx.lookup(\"java:comp/env/tommy/stdin\");

/* get standard output (stdout) */
PrintStream stdout = (PrintStream) ctx.lookup(\"java:comp/env/tommy/stdout\");

/* get standard error (stderr) */
PrintStream stderr = (PrintStream) ctx.lookup(\"java:comp/env/tommy/stderr\");

/* get \"--app\" parameter value */
String app = (String) ctx.lookup(\"java:comp/env/tommy/app\");

// ...

F.A.Q.

Q. My app failed with java.lang.ClassNotFoundException: javax.servlet.*

A. As a result of the move from Java EE to Jakarta EE, starting from v10, Apache Tomcat supports only the Jakarta EE spec. javax.servlet.* is no longer supported.
Replace the javax.servlet.* imports in your code with jakarta.servlet.*.

下载源码

通过命令行克隆项目:

git clone https://github.com/xnbox/tommybox.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 开发教程 tommybox https://www.zuozi.net/31248.html

常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务