0

I have written a very simple Java application. Can anyone tell me how to create a launcher like icon to run that application both in Ubuntu and Windows ??

Thanks in advance..!!

asked Jul 23, 2010 at 15:59

5 Answers 5

6

An executable JAR should work fine for a launcher on both Windows and Linux. However, that won't get you a custom icon.

On Windows, you can use JSmooth, which will create a .exe wrapper around your JAR file. The JSmooth program will let you create an icon for the EXE as well (it also has options such as getting the user to download the necessary version of the JVM, or only permitting one instance of the program to run).

answered Jul 23, 2010 at 16:14
Sign up to request clarification or add additional context in comments.

Comments

2

If your java application is to be distributed from a web server, you should have a look at Java Web Start which can do what you ask for based on a JNLP-file. Notably see

http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/guide/javaws/developersguide/faq.html#104

answered Jul 23, 2010 at 16:03

Comments

2

Ubuntu and Windows will both have different ways to launch the application. I see two routes to follow here. One is to use Java Web Start and use a web interface to start your application. The other is to search for some sort of 3rd party installer that will create setup/installation programs for all the platforms you want to use.

I actually used a third party install program before, InstallAnywhere, but it was almost ten years ago. It offered the functionality you are looking for, though.

answered Jul 23, 2010 at 16:04

Comments

1

There are different ways to do this, sometimes the simplest is the best approach. One solution as suggested is a simple starting script. Roll your application into a jar, then include a script that does nothing more than "java -jar myscript.jar". I do this all the time for internal customers that may be running various types of *nix and whatever version of windows (a few macs as well). How sophisticated you need it to be depends on the audience served.

answered Jul 23, 2010 at 16:10

Comments

0

Create a bat/shell script which starts your application. And than create a shortcut/launcher for it.

Shortcut file in windows has extension lnk.

Update

See example - SQuirreL launch file.

answered Jul 23, 2010 at 16:06

2 Comments

The problem is there is no universal bat/shell script that will work for Unix and Windows. Nor is there a universal method for creating the shortcut or launcher.
Sure, you have to create two scripts. You can take a look how it's done in SQuirreL.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.