How do you compile a java file to an .EXE???.

2005-06-28
2012-08-29
  • Nobody/Anonymous

    Hi,Ben.

    I wish to know how you convert your java program to an executable file( JAVA to EXE). Which program do you use??? . Is Ant who comes with eclipse???.. If is so, how yo do that,,( parameters, etc...).

    Thanks..

    Im a newbie, and i am studiing your program to learn more java, but i dont understand how compile a java file to an .EXE like you do in your program.


     
    • Anonymous

      Anonymous - 2005-06-28

      The "rssowl.exe" is just a small application that executes Java. RSSOwl is not compiled to native, only the Java launcher is.

      I am using the Nullsoft Scriptable Install System. Find it at http://nsis.sourceforge.net.

      The script I am using is online here:
      http://nsis.sourceforge.net/wiki/Java_Launcher

      Ben

       
      • Anonymous

        Anonymous - 2005-06-30

        NSIS indeed works great to create a .exe that launch a Java application. I tried it with the script above, and was able to make it work fine, but it keeps a console window opened (with title "C:\Program Files\Java\jdk1.5.0_03\bin\java.exe").

        How did you make this window go away ?

        Thanks.

        • Guillaume

        PS Here's the SWT snippet I used to test:
        /****/
        public static void main(String[] args) {
        System.setProperty("java.library.path","./");

        Display display = new Display();
        Shell shell = new Shell(display);
        shell.open();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }
        display.dispose();
        

        }
        /****/

         
        • Anonymous

          Anonymous - 2005-06-30

          Just replace the "java.exe" with "javaw.exe" and it should not show any console window.

          Ben

           
    • Nobody/Anonymous

      And i have a question about RSSOWL programming...

      Why you dont program more with Jface???. For example, with Jface.document/Idocument o Jface Text/Itext..... I think would do your program good looking (more than now)...

      And another question....why you dont use a database to manage the data of your program?? feeds,etc....

      Bye!!!

       
      • Anonymous

        Anonymous - 2005-07-01

        Very good questions indeed.

        Short answer: I began RSSOwl with not the slighest knowledge of JFace and persistance was no topic 2 years ago.

        Wait for the next major release of RSSOwl and you will see such things in action :)

        Ben

         
    • Nobody/Anonymous

      And how you export your program??..
      I mean, when i compile my program , in eclipse runs fine, but when i exit eclipse, and i execute my jar file, this says to me that "no main class is found " . In eclipse i look for the manifest *.MF and is all right, but outside of eclipse , dont execute.
      I do: Export... next...next...select the main class and says "all right", but after, when i exit eclipse, i try to execute the generated jar file and not running.

      I think all is right and i dont find where is the problem??
      Could you help me??

       
      • Nobody/Anonymous

        I am using ANT to export RSSOwl outside Eclipse. In order to execute the JAR you need to specify the class containing the main-Method in the Manifest file.

        Ben

         
    • Nobody/Anonymous

      im sorry. I dont know how doing that...

      i have a mini-program but i dont know how execute it in windows with swt...
      all the settings, path and so, are right...
      i do the manifest file but dont run. Could you explain how to compile a program with swt like yours.. My email is vicenterg@arrakis.es if you want to help me
      Thanks a lot for your help until the moment....
      If you want you can answer here in the post , but i prefer the e-mail because i have many questions. I am 17 years old and i wanna be a programmer like yours.
      Thanks!!

       

Log in to post a comment.