Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a stand alone Java application

Is it possible to create a stand alone application in Java (using Swing) and package it into an exe file?

My Idea is, we should be able to double click it and run the application.

like image 207
user2434 Avatar asked Dec 13 '22 08:12

user2434


2 Answers

If you export a runnable .jar file you will be able to double click and run, but you'll still need the JVM in order to interpret the bytecode.

like image 65
Heisenbug Avatar answered Dec 31 '22 19:12

Heisenbug


The best way to deploy a Swing based app. to a client's desktop is using Java Web Start.

JWS offers desktop integration - making a desktop shortcut and menu item, each using an icon if specified. The end use can double-click the desktop shortcut cut to launch the app. ( or single-click the menu item to do the same ;).

Best of all, JWS works for all platforms for which the J2SE is supplied. Windows, Ubuntu, Fedora, Solaris, Mac. OS..


For ensuring the user has the correct minimum JRE needed to run the app., use deployJava.js to write the link to the JNLP launch file.

like image 28
Andrew Thompson Avatar answered Dec 31 '22 18:12

Andrew Thompson