File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Is there a way to get a stand alone executable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Is there a way to get a stand alone executable?" Watch "Is there a way to get a stand alone executable?" New topic
Author

Is there a way to get a stand alone executable?

Lazaros Lazarou
Greenhorn

Joined: Feb 13, 2001
Posts: 2
Hi-
I was wondering if anybody knows how can i get a stand alone executable file for an application that i write. Is there a compiler that can do that for me? where could i get one and how much is it going to cost?
Thanks in advance
lazaros
Scott Pedigo
Greenhorn

Joined: Feb 15, 2001
Posts: 15
Netscape 6 and StarOffice were written in Java - you can tell from the look-and-feel and how slow they run. But they look like regular applications, so they must have a build-in JVM, which is what you need. Since Netscape 6 is based on an open source project, you might be able to get some information on how to do this by tracking that down.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Lazaros,
The only free way to create an executable from Java code is via GCJ, provided by Gnu( www.gnu.org ) which translates your Java code to C++ which is then run through the GCC compiler. I believe this is for Unix based systems only... Several IDEs (I believe IBMs VisualAge, and I have heard Visual Cafe) support some kind of native code generation which consists of packaging a small JVM, your class files, and some kind of code to make the JVM execute them all together into an executable file. I think J++ (gag!) also supported native code compilation, probably through Visual C++, so your code could become more platform dependant than it already was...
Anyway, as far as native compilation goes, think about it long and hard before you do it... one of the major reasons to write a program in Java is the "Write once, run anywhere" philosophy, and native code compilation destroys this...
HTH,
-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Let's back up a moment here. WHY do you want it to be an executable?? There are several ways to invoke java applications without converting them to exe's.
Howeveer, for creating an installation executable I hear that InstallSheild is quite good http://www.installshield.com/


"JavaRanch, where the deer and the Certified play" - David O'Meara
Neeraj Vasudeva
Greenhorn

Joined: Feb 07, 2001
Posts: 12
Can i do create java exe from the software availble at www.installshield.com ?
bye
Neeraj Vasudeva
------------------
Come to my site...http://www.sunjavacertification.com & explore the things..i am a new bie in java.


Come to my site...http://www.sunjavacertification.com & explore the things..i am a new bie in java.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Well, I still don't know WHY you are trying to make an exe however:
InstallSheild creates an executable out of your application so that you can point at it from a web page and the user can download it and it will install the application on his machine.
JToEXE creates an exe to kick off the application, although the class files are still used. http://www.bravozulu.com/Products/JToExe/jtoexe.html
javaw invokes an application without the DOS window (which seems to be why some people are trying to create exe's). javaw comes with the SDK and JRE.
Matt DeLacey
Ranch Hand

Joined: Oct 12, 2000
Posts: 318
Seems like one reason WHY (or the my reason anyway), is if you want to write an app, distribute it, and not assume that everyone has a JVM on their box. I have heard about making a .jar and modifying the Manifest file, but do you have to include the jvm and the jre in the jar? Is that kosher with Sun? Do you need to include anything else in the .jar if you are assuming the user has no Java stuff on their machine?

With Respect,
Matt
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
If the user doesn't have a JVM installed, the user's system won't know what to do with a jar file.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a way to get a stand alone executable?