electron-java-wrapper
electron-java-wrapper copied to clipboard
Wrap your Java Web Application in Electron
Electron Wrapper for Java Web Apps
Wrap an existing Java Web Application with Electron without touching your code.
Uses
- Node JS
- Electron
- Java VM
Try it!
Preparations
- Download and install
npm
from https://nodejs.org/en/download/ - By default the Java web application is required to run on
localhost:8080
(configure if otherwise underelectron-src\main.js:78
). - By default
java
needs to be available via the path variable (configure if otherwise the path in the main.js) - The provided Jar needs to be executable via
java -jar <file>.jar
. - Place your built (Fat-)Jar in the
jar
folder.
Features
- Starts a (Fat-)Jar
- Shows during f.e. Servlet Container startup a loading Animation (can be replaced)
What can be customized?
Basically everything but you will need to rebuilt the application most of the time f.e.:
- Logging (under
.\electron-src\main.js:74
) - Loading animation (under
.\electron-src\
replace theloading.html
file) - Loading animation window size (under
.\electron-src\main.js:58-59
) - Application icon (under
.\electron-src\
replace theicon.ico
file) - Main window title (under
.\electron-src\main.js:103
) - Main window size (under
.\electron-src\main.js:104-105
) - Special run parameters to be passed to the jar (under
electron-src\main.js:67
)
Running debug version
Windows
> electron-app-debug.bat
Unix
> ./electron-app-debug.sh
Build application for host arch
Windows
> electron-app-package.bat
Application will be bundled to output/electron-vaadin-...
(pending on the system you compile on)
Unix
> ./electron-app-package.sh
Application will be bundled to output/electron-vaadin-...
(pending on the system you compile on)
Build application for all archs (Window 32 + 64 Bit, Darwin ...)
Windows
> electron-app-package-all.bat
Application will be bundled multiple times for all archs output/electron-vaadin-...
Unix
> ./electron-app-package-all.sh
Application will be bundled multiple times for all archs output/electron-vaadin-...