wood burning stoves 2.0*
The moose likes Java in General and the fly likes How to convert java file to .exe file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to convert java file to .exe file." Watch "How to convert java file to .exe file." New topic

How to convert java file to .exe file.

Prabhat Gupta
Ranch Hand

Joined: Jan 22, 2008
Posts: 135
Hi Ranchers,
May be i am crazy to ask such question.

Suppose i have a java file say file1.java . If i have to run it at first i will compile it,then run the class file with java command.
Sometimes i dream that it will be nice to convert that .java file into some .exe file and when user clicks on that it should start running (of course it should compile it in background do you not feel to compile and run the java file is very monotonous work.

So can you come up with some ideas to realize my dream?
i m going to sleep now
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41054
Your dream can easily come true. That's what jar files are for. The code won't be native, though, so you still need a JRE installed. But the application will be double-clickable.

Ping & DNS - my free Android networking tools app
Prabhat Gupta
Ranch Hand

Joined: Jan 22, 2008
Posts: 135
Thanks ulf!!!

Fantastic stuff!!!
Parham Emami

Joined: Jul 11, 2003
Posts: 15
hello there,

you could also create an OS related script (.sh or .exe) containing the -java command to run your CLASS file. be aware that from OS perspective, this script should be eligible to recognize your JDK and your class file.

sunny chellan

Joined: Apr 24, 2008
Posts: 2
Inno set is windows installer
prepares a exe file for java
I agree. Here's the link: http://aspose.com/file-tools
subject: How to convert java file to .exe file.
Similar Threads
Running a .exe file from a .java file
how to create .exe in java
what is urs
Java Portability ?