can any body tell how to create java application to exe file?
thanks in advance
Sanjay KumarB
Greenhorn
Joined: Aug 10, 2009
Posts: 6
posted
0
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.
Regards,
Sanjay Kumar
.~~ If you can't win by your strength, then win it by opponent's weakness ~~.
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.
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.
avi sinha
SCJP 5.0 SCWCD 5.0
vijayakumar durai
Ranch Hand
Joined: Aug 18, 2008
Posts: 153
posted
0
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 ?
thanks in advance
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35239
7
posted
0
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.
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.
vijayakumar durai
Ranch Hand
Joined: Aug 18, 2008
Posts: 153
posted
0
ok i will explain full details of what i done
i have created Manifest.txt
MyClass.java
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.