Creating a standalone Java application

Is it possible to create a standalone Java application (using Swing) and pack it into an exe file?

My idea is that we have to double-click it and launch the application.

+4
source share
5 answers

If you export the .jar executable, you can double click and run, but you still need a JVM to interpret the bytecode.

+6
source

The best way to deploy a Swing based application. client desktop uses Java Web Start .

JWS offers integration with desktop systems - creating a shortcut on the desktop and a menu item, each of which uses an icon, if one is specified. End use allows you to double-click the shortcut on the desktop to launch the application. (or once click on a menu item to do the same;).

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


To ensure the correct minimum user JRE to run the application, use deployJava.js to write a link to the <file href = "/ questions / tagged / jnlp"> JNLP.

+3
source

If you export the project to a .jar file, you can run it when you click on it.

I assume that you know that the virtual machine must be installed on the computer on which the program is running. (A virtual machine is what allows java to be independent of the operating system)

And also you should know that if you convert this .jar to a .exe file using some kind of gadget ... Then java will no longer be java, because it will not be able to run it on operating systems without a window,

Remember the slogan java

'Record times in a row everywhere'

Check out this image here, I will explain to you how to create .jar using the eclipse environment:

enter image description here

1 - select the project in the package explorer

2-Choose "File"> "Export" from the menu

3-pick runnable jar file from dialog and

4-Click on and follow the rest of the wizard

+3
source

You can pack the application in a JAR file. The application in the jar file starts when the duoble button is pressed. Here is a tutorial. http://download.oracle.com/javase/tutorial/deployment/jar/

+1
source

You can already do this with a regular .jar file if the user has configured the extension to be executed using the JRE. But you can always use something like Launch4J . Please note that this simply transfers the Jar to an EXE file. The file still needs your dependencies (.jars) and the JRE environment.

0
source

Source: https://habr.com/ru/post/1379275/


All Articles