help for creation of an executable file from a simple java source file
Sir,
I am new to java pgm..i have created a simple java source file ,say helloworld.java which is having a main method.it just prints hello world on the dos screen if i am running it from dos prompt.
Now i want to create a executable/application file from that source file.(how to do that ?)so that one can click that file and see the o/p .my idea is to give that file to a person who does not have idea of java and he will run it on his own m/c.So pls tell me what are the things to be bundled with my exe file and delivered to him ,so that when he install my application and click the "helloworld" file he can see the o/p i.ehello world.
Pls help me in learning this concept.
Thanks
Arup
> Now i want to create a executable/application file from that source file.(how to
> do that ?)
The usual approach is an executable .jar file, as described here:
http://java.sun.com/docs/books/tutorial/deployment/jar/index.html
or just http://www.google.com/search?hl=en&q=executable+site%3Aforum.java.sun.com&btnG=Search&meta=
I've had the same problem, dealing with totally java ignorant users and tried some java to native code programs.
There are two problems:
-They are not free.
-Why renounce to platform independence?
So, executable .jar are definitely the solution. They work just as an executable [point & click]. They obviously need JRE [or JDK] properly installed on the user machine.
If you make a .jar file, you friend that use your application must to have the Java Virtual Machine.....
If you don't want to spend any money this is the only solution.
However, for professional solution, there are the Installer, that provide to create an executable file that installa your application and then run with a click. This installer include a Java Virtual Machin with your application, so your friends doesn't know anything about Java.
bye