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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "making exe file from java code" Watch "making exe file from java code" New topic
Author

making exe file from java code

christine clarin
Ranch Hand

Joined: Feb 05, 2005
Posts: 106
hi, i nid some help in making an exe file from my java codes, i have several classes, one which has the main function, and i need to make an application (.exe) file from it, how can i do this? is there a software which can do this (i really just need to generate an exe file) or anything that i could use/do? we tried using exej.exe for this but it doesn't work, are there any others out there? thanks!
Jayant Raj
Ranch Hand

Joined: Mar 11, 2004
Posts: 42
Hi Christine,
An excellent tool for solving ur problem is JSmooth. The url is http://jsmooth.sourceforge.net/ . I have used this tool in production . This gives u an exe wrapper over ur jar file. Try this and let me know if u need further help.


regards,<br />Jayant Raj<br /> <br />SCJP 1.4 [98%]<br />SCWCD 1.4 [91%]<br />SCBCD [In Progress]
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Any specific reasons for making java as platform dependent ??


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
christine clarin
Ranch Hand

Joined: Feb 05, 2005
Posts: 106
thanks! I'll be trying JSmooth now. I am doing this for my undergraduate thesis, I've developed an entire system using java and my professor wants me to be able to install it in any computer which may not have java available on it. in short, he requires that I make an application out of it. if i don't then my thesis isn't considered as finished. i hope you could really help. thanks. i am actually graduating this April
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
.exe files are specific to the Windows platform, so as mentioned above, this will make it so your program cannot run on other platforms. You should check out our FAQ for other suggestions that essentially have the same effect. In particular, scroll down to question #16 which has a few links for you to read about the other options you have.

Layne


Java API Documentation
The Java Tutorial
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
The short: if you're told to create an application get the specs right before you start and choose your tools accordingly.

You can get your installer to install a JVM or set your system specs to include a JVM.
If the requirements you were given preclude that option you shouldn't have used Java to start with and your prof is quite right in telling you you're not done until you have a native application for the platform, something you should have considered before using Java.
Would you have used Visual Basic to create an application if you were told it had to run natively on a Sun SparcStation under Solaris?


42
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
Why not try using Java WebStart? That way, it can be run on any computer that has the appropriate version of Java. Also, it's easy to "install" as it's just a link on a website. Good luck!


James Carman, President<br />Carman Consulting, Inc.
K Riaz
Ranch Hand

Joined: Jan 08, 2005
Posts: 375
Originally posted by christine clarin:
my professor wants me to be able to install it in any computer which may not have java available on it.


I would question you professors knowledge in this area. Surely he knows that to run a Java program, you need, at the very least, a Java Runtime Environment? It is a very foolish requirement. I can only assume that he has only ever written software for production on native platforms.

The best thing to do is to make an installer (lots on sourceforge), bundle the JRE so if it detects no Java, it can install it. Otherwise, it can copy a JAR file with your project and a shortcut to a Windows Batch file to run the JAR.

Avoid making a native executable.
[ March 29, 2005: Message edited by: Kashif Riaz ]
christine clarin
Ranch Hand

Joined: Feb 05, 2005
Posts: 106
TO ALL: thanks for the help guys. My thesis is already finished! All I have to do is write the paper now...

hi jayant Raj, i tried using JSmooth, it worked but we opted for exej, it's a wrapper too. thanks for the help!

Quoting Jeroen Wenting "The short: if you're told to create an application get the specs right before you start and choose your tools accordingly."
-- hi jeroen, we were instructed to program in Java, we didn't know we had to produce an application until the semester was about to end. anyway, everything turned out well. we just installed a JVM

Quoting james Carman "Good luck!"
-- thanks!!! �

Quoting Kashif Riaz "I would question you professors knowledge in this area. Surely he knows that to run a Java program, you need, at the very least, a Java Runtime Environment? It is a very foolish requirement."
-- yes i think he doesn't know much about java, he's more of an algorithm guy, more on AI.


THANKS AGAIN!
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
OK, you didn't say that Java was a requirement
If it was and later you are told you need a native application then you have clashing requirements.
The realworld solution would be to either convince the customer that the two requirements are mutually exclusive.
Seems you've done that and gotten permission to install a JVM
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: making exe file from java code