# Making a stand-alone executable from a Java program

**URL:** <https://boards.straightdope.com/t/making-a-stand-alone-executable-from-a-java-program/438782>\
**Category:** Factual Questions\
**Created:** [February 22, 2008, 10:36pm UTC](https://boards.straightdope.com/t/making-a-stand-alone-executable-from-a-java-program/438782 "2008-02-22T22:36:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Captain\_Carrot](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@Captain\_Carrot](https://boards.straightdope.com/u/Captain_Carrot)\
**Post date:** [February 22, 2008, 10:36pm UTC](https://boards.straightdope.com/t/making-a-stand-alone-executable-from-a-java-program/438782/1 "2008-02-22T22:36:36Z")

</div>

Okay, so say I have a program that reads in two files, does stuff, and prints the result to a third file. This program is in the form of a .java file and a .class file. How can I turn those into a .exe program that will run on someone else’s computer without them having to do anything funky with manually running it or anything like that? In other words, the user double-clicks on the executable icon, and the program just runs.

(This is not homework, I’m doing a favor for my mom.)

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [February 22, 2008, 10:42pm UTC](https://boards.straightdope.com/t/making-a-stand-alone-executable-from-a-java-program/438782/2 "2008-02-22T22:42:14Z")

</div>

I’ve personally never bothered because I thought it defeated the purpose of Java, but here’s a website outlining various methods of making an executable on double-click jar.

> **[How to Start a Small Business in USA - Step by Step Guide](https://llcbuddy.com/start-small-business-in-usa/)**
>
> How to Start a Small Business in USA? It is easy if you follow these simple steps. Here's what you need to know before you start a small business!

Edit: Come to think of it, on occasion i did use the jar manifest option

---

<div class="post-metadata">

**Author:** ![Capt.Ridley\_s\_Shooting\_Party](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Capt.Ridley\_s\_Shooting\_Party](https://boards.straightdope.com/u/Capt.Ridley_s_Shooting_Party)\
**Post date:** [February 22, 2008, 10:43pm UTC](https://boards.straightdope.com/t/making-a-stand-alone-executable-from-a-java-program/438782/3 "2008-02-22T22:43:20Z")

</div>

I know two methods: you can compile with gcj to create a native executable, or create an [executable JAR file](http://csdl.ics.hawaii.edu/~johnson/613f99/modules/04/jar-files.html).

---

<div class="post-metadata">

**Author:** ![ticker](https://avatars.discourse-cdn.com/v4/letter/t/d07c76/32.png) [@ticker](https://boards.straightdope.com/u/ticker)\
**Post date:** [February 22, 2008, 10:50pm UTC](https://boards.straightdope.com/t/making-a-stand-alone-executable-from-a-java-program/438782/4 "2008-02-22T22:50:31Z")

</div>

If you create an executable Jar file the target machine will still need to have a Java runtime installed, but otherwise the result is just like clicking on a .exe.

---

<div class="post-metadata">

**Author:** ![Captain\_Carrot](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@Captain\_Carrot](https://boards.straightdope.com/u/Captain_Carrot)\
**Post date:** [February 23, 2008, 2:00am UTC](https://boards.straightdope.com/t/making-a-stand-alone-executable-from-a-java-program/438782/5 "2008-02-23T02:00:17Z")

</div>

Thanks for your help, guys. I ended up going in a different direction\*, but this will still probably be helpful when I have a course that requires me to use Java.

\*-I found a program that converts Python to .exe, and I found a decent tutorial on a Python extension GUI.
