as running any exe file or something..??
Asked
Active
Viewed 5,649 times
3
-
What's the context - are you planning to distribute a Java app you created, or just want to launch a Java app you have through an icon? (In the latter case this will be migrated to Super User.) – Jonik May 02 '10 at 12:15
-
Im trying to launch a Java app i created :) – wam090 May 02 '10 at 12:20
-
1Then you'll find lots of useful information at http://stackoverflow.com/questions/80105/whats-the-best-way-to-distribute-java-applications. If you want to create an independent exe (with JRE bundled in), take a look at Scott's answer below (http://stackoverflow.com/questions/2753371/can-i-run-a-java-program-through-an-icon-on-my-desktop/2753396#2753396) or these older questions: http://stackoverflow.com/questions/2258932/embed-a-jre-in-a-windows-executable and http://stackoverflow.com/questions/2712768/how-to-make-java-application-standalone – Jonik May 02 '10 at 12:29
3 Answers
2
Make an executable JAR file:
http://csdl.ics.hawaii.edu/~johnson/613f99/modules/04/jar-files.html

Amber
- 507,862
- 82
- 626
- 550
-
-
1@Sean: Seeing his other questions on the Java subject, JWS is probably far beyond his actual intent and understanding. An executabele JAR is the most straightforward choice here. – BalusC May 02 '10 at 13:39
-
... but this would not be double-clickable like an .exe. A JWS file would. – Sean Owen May 02 '10 at 16:03
-
Not true, Sean. On most systems executable JARs are double-clickable as long as a JRE is installed. – Amber May 02 '10 at 19:33
2
Use Java Web Start to package and deploy your application on a web server.
During launch, It will create desktop shortcuts that can connect to a server and update your application if updates are found.
It also has other advantages, like the fact that it can ensure that you have the right virtual machine, and download the right one in case you don't

Mario Ortegón
- 18,670
- 17
- 71
- 81
1
You can create an executable with one of the following:

Scott Bennett-McLeish
- 9,187
- 11
- 41
- 47
-
2You can create desktop icon to launch Java app without repackaging it as exe. Depending on what OP actually wants, this may be overkill. – Jonik May 02 '10 at 12:11
-
for example i want to send this file to some one.. he/she must have the java library on his/her computer right..?? – wam090 May 02 '10 at 12:15
-
@WM, If you want to create a file that can be executed regardless of whether there's JRE installed, then indeed you should look at tools that can create an exe with bundled JRE, such as Launch4j or exe4j mentioned by Scott. – Jonik May 02 '10 at 12:20