You can create the setup.exe file for a java application using some tools like installshield, installJammer, installanywhere. But these softwares are not freeware.
And one more problem is like, the user who installs your java application should have the JRE. So its not applicable in small applications.
Example, I have created one Calculation application. Only one class is there that extends JFrame and has implementation for basic calculation process. The whole application size will be less than 500 KB. But to run this, one needs a JRE. So you have to keep this JRE file along with your application for installation.
So if you will see logically, why an user will agree to install a JRE of more than 70 MB for an application of size 500 KB.
.~~ If you can't win by your strength, then win it by opponent's weakness ~~.
why do you want to convert it into an exe file ??? by converting it you are just making it unportable in my opinion.
compress the byte code of your application in a jar file and it can be executed just by clicking over it twice (if you have installed the jre ).
otherwise you can use one of above mentioned jar to exe converters.
SCJP 5.0 SCWCD 5.0
Joined: Aug 18, 2008
we created jar file it will like winzip format if we double click can any body tell how to create jar file if we click the jar file our application will run?
vijayakumar durai wrote:we created jar file it will like winzip format if we double click can any body tell how to create jar file if we click the jar file our application will run?
thanks in advance
there is no any difference in the command which is used to create a jar file. it depends upon the application being used to open it.
many compressing tools like winRar , winZip etc consider a jar file as a compressed file .( its correct) but it can be executed by executing it using java runtime file .
i have created jar file Myjar.jar if i run in dos prompt java -jar Myjar.jar it execute application when i double click jar file it will open in notepad. i need if i double click the jar file application will run is there any software need what i have to do ?
i have changed jar file to open applcation in java setting mycomputer->tools->folderoptions->filetypes->jar file in this path i click the change and set the jdk->javaw.exe .if i double click the jar file .i got error couldnot find main class program will exit . i am not able to run in dos prompt also
can any body tell how to associate jvm with jar file?
What's in your manifest file? Also, unfortunately, javaw shows this message for any exception thrown by the JVM. The problem may be something completely different. Try running the JAR file from the command line: That will show you exactly what is going wrong.
Joined: Aug 18, 2008
ok i will explain full details of what i done
i have created Manifest.txt
then i create jar file
jar cvfm myjar.jar Manifest.txt *.class
now i can able run in dos prompt
if i am double click jar file. i got error couldnot find main class program will exit can any body tell how to associate jre with jar file
My advise is to use exe that launches java virtual machine. These are tools similar to javaw application, which contain information about classpath, java and app parameters internaly. They load jvm.dll (java.dll) and invoke main method of main class.