Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export .jar with icon and native extension under Eclipse

Tags:

java

eclipse

jvm

I have developed a Java application with Eclipse. I have also exported in the .jar format. It works great, but there are some issues;

  1. The icon is the one of the JVM and can't be modified
  2. If the PC where the application runs, it will not have the Java SDK, the application can't start.
  3. In some case, for example Linux, the application will not start if the user select the box authorize.

So at the end, I want to transform the .jar file, into the native format for the other OS, such as .exe, .app and .deb with a specific icon. How Can I do this ?

like image 489
I love coding Avatar asked May 08 '15 08:05

I love coding


People also ask

What is the difference between JAR and runnable JAR?

FYI: In simple terms, the difference between a JAR file and a Runnable JAR is that while a JAR file is a Java application which requires a command line to run, a runnable JAR file can be directly executed by double clicking it.


1 Answers

1) The icon is the one of the JVM and can't modify
2) If the PC where the application runs, it will not have the Java SDK, the application can't start.

There is a way to Embed a JRE in a executable. This way you can create native build for target systems which will 1) allow you to change the icon 2) make app run on PC where JavaVM is not installed.

I recommend using Avian which is free: http://oss.readytalk.com/avian/

Also you might be interested in this thread: Embed a JRE in a Windows executable?

like image 113
Praeterii Avatar answered Sep 27 '22 19:09

Praeterii