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.
Sanjay KumarB wrote:You can create the setup.exe file for a java application using some tools like installshield, installJammer, installanywhere. But these softwares are not freeware.
Inno Setup and NSIS are, and can do the same.
But you are right, Java code can (as far as I know) not be compiled into real native code on Windows*, and so it will always require a JVM installed on the system.
* For Linux you have GCJ which has ported a subset of the core API to native code. It lacks a lot of user interface code (from Swing mostly) though.
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.
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 .
How to run a Jar file
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 ?
You need to associate one of the JVM executables with jar files, probably java.exe or javaw.exe. This normally happens during JVM installation; maybe the setting got changed up later.
can any body tell how to associate jvm with jar file?
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.
You can visit http://www.geocities.com/j2exe
There is a free tool for non-comercial use.