Pulkit
Pulkit

Reputation: 4084

how to make a swing as a exe file

I have java class in which I am doing some business functionality, now what I want is a standalone file so that user dont need to write java command to execute it but he can directly execute it as .exe file. Can anybody help me in this? I hope I was clear

Upvotes: 1

Views: 5430

Answers (4)

Pulkit
Pulkit

Reputation: 4084

in simple word make a jar and in manifest file put the entry point that is you swing main class which you want to run, Make sure you jar is correctly compiled with JRE version,

Upvotes: 0

Matthieu
Matthieu

Reputation: 3097

Have a look at launch4j. It encapsulate a jar into a .exe.

It has a lot of other useful functionalities such as checking for the correct JRE version or giving download links in case Java is not installed.

Upvotes: 2

JanC
JanC

Reputation: 335

I would recommend to create a JAR file of your Java classes.

JAR file can be executed with: java -jar filename.jar

For default installation in Windows, there will be a file association between JAR files and Java, such that one can double click on the jar file to execute it (i.e., it behaves like an exe file).

Upvotes: 2

sanket
sanket

Reputation: 789

First make a jar file and then wrap your jar file into .exe. There are plenty softwares available. Just google jar to exe

Upvotes: 2

Related Questions