CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 1999
    Location
    Germany
    Posts
    42

    Make a Executable

    Is there a possibility to make an Executable (*.exe e.g. Windows) from Java Files ?



  2. #2
    Join Date
    Mar 2000
    Posts
    123

    Re: Make a Executable

    You can make a .jar (java executable) file.


  3. #3
    Join Date
    Nov 2000
    Posts
    23

    Re: Make a Executable

    use a batch file to avoid using javac *.java and java *.class each time you run a program


  4. #4
    Join Date
    Jan 2001
    Posts
    27

    Re: Make a Executable


    This was posted on some forum I just found, very helpful. Your application is named MyJavaApplication in the example. Cut and paste and replace and your set.

    hello,

    To convert MyJavaApplication.java

    to an executable file convert that file into a batch file MyJavaApplication.bat


    .........................

    1. compile and test your java file and make sure it works fine.

    2. create a batch file as follows.
    a: write java MyJavaApplication

    in notepad.
    b: save this file as MyJavaApplication.bat



    Now doubleclick this file and you shall see your java file running.

    This is a coarse way of creating an executable file. Also, you can modify the properties of the Batch file so you can have the command prompt window auto close when you close the application, otherwise you have to manually close both.

    If anyone knows how to make it invisable from the batch file, that would completely rock.



  5. #5
    Join Date
    Mar 2001
    Posts
    33

    Re: Make a Executable

    There are native byte code compilers which will convert .class files into an .exe file

    there might be a couple eval versions out on the net...




  6. #6
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Executing Java programs on Windows

    There are two other ways to single click execute java programs on Windows (I'm on Win9X).
    1) Create a short cut, right-click it and select properties. Enter the commandline and the starting directory and set the Icon.
    2) Add a choice to the Windows Explorer right-click/context menu: In W Explorer View|Options select FileTypes.
    Find existing extension and Edit it or add a New one if not there. Use New to add your new commandline. Be sure to put paths in "" in case there are spaces in the name. First line is the menu, second is the commandline. Use "%1" in the commandline to pick up the name of the file you've clicked on.

    Norm
    Norm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured