Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tiny exe to launch a java application

Tags:

java

exe

Some questions are like: How can I package my java app into an exe ? This is not what I am going to ask.

I can launch my application by doing the following:

java -jar myApp.jar 

That works perfectly (Assuming the machine has java 1.5.0 or >)

Now what I was thinking of having is a myApp.exe file.

What it would do is the following:

  1. check if java is installed on the machine and its version. if java is not there it would prompt a dialog to say: "you need to install java to run myApp" exactly like eclipse.exe does if it does not find java. it would then terminate.
  2. if java is there, then effectively run the command javaw -jar app.jar and spawn the process.

any idea ?

like image 930
chacko Avatar asked Apr 01 '11 10:04

chacko


People also ask

Can Java be exe?

The Java Packager tool compiles, packages, and prepares Java and JavaFX applications for distribution. The javapackager command is the command-line version. The javapackager utility ships with the JDK. It can generate .exe files with the -native exe flag, among many other things.

What is the name of the Java executable file?

“java.exe” and “javaw.exe”, both are Java executables on the Windows platform. These files are nearly identical versions of the Java Application Launcher utility.


1 Answers

JSmooth does exactly that.

like image 147
jmg Avatar answered Sep 22 '22 11:09

jmg