Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there a way to get a stand alone executable?

 
Lazaros Lazarou
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
 
Neeraj Vasudeva
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the user doesn't have a JVM installed, the user's system won't know what to do with a jar file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic