Friday, May 21, 2010

How to compile java program into windows executable?

Please suggest websites or a tutorial on how to accomplish it. I saw something about some batch file but nothing conclusive.

How to compile java program into windows executable?
Here's a great step by step doc. It keeps the details to a minimum. There is much more power available in jarring a java file.





http://csdl.ics.hawaii.edu/~johnson/613f...





Another POV:


If possible, collect all your .java files and .class files (and anything else you want to include) together in a single directory.


Using a text editor, create a file (say, myManifest) containing the following lines:





Manifest-Version: 1.0


Main-Class: MyMainClass





where MyMainClass is the name of the class containing the main method you want to use.


From the command line, execute the command:





jar cvfm myResult.jar myManifest *.java *.class





where myResult.jar is the jar file you are trying to create, myManifest is the file you created in step 2, and everything else is the files you want to include.








Good luck.
Reply:are you sure you need a windows executable? if you create a Java ARchive (JAR) correctly, a windows user can double click it and it will launch as if the application is an EXE file.
Reply:Check out JSmooth. It will allow you to put any java into an exe wrapper.
Reply:You need to buy a compiler, or find a free one. Here is more info on why you shouldn't compile

plants

No comments:

Post a Comment