Himz
Himz

Reputation: 523

Java application deploy

I have a Swing desktop application and have created a jar file which depends on library (which is kept in ./lib/) and a .txt file in the same folder. Now to execute the jar I have written a .bat file which checks if Java is installed or not. If installed then I run the jar file with command:

javaw -jar TagEdit.jar

Now there are two problems I am facing with this:

  1. I would rather prefer a single executable, if possible.
  2. As using bat file, the console is visible in back (looks kind of weird). Is it possible to turn it off?
  3. Java is everywhere, and there are lots of applications that are built in Java and packaged in a setup, or given as exe. I Googled a lot but could not find a way to create a setup for the software or an exe. How are those software packaged?

Have tried jlaunch, but could not get that to work correctly.

Upvotes: 0

Views: 647

Answers (3)

There are various answers to this.

  • javaws.exe will execute the jar without the console appearing behind

But I feel this isn't really the best way.

  • I think should investigate using Java Web Start, So you create a JNLP file and have it jar downloaded from the web, I think, you can also have a desktop icon.

If you don't want that

  • I think you can get/buy binary wrappers for the jar.

Upvotes: 1

DejanLekic
DejanLekic

Reputation: 19787

Himz, Eclipse can automatically build a so-called "fat-jar" for you. It is a jar that contains all the dependencies you need.

If you are a happy Maven user, then you have two brilliant alternatives - the shade plugin, and the assembly plugin. They both can produce a "fat-jar" for you. :)

Upvotes: 1

user147373
user147373

Reputation:

You could convert it to an executable. Try Googling java to exe.

Once that is done, you could package it up as an installer using NSIS.

Upvotes: 0

Related Questions