Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Jar File to executable file

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Jar File to executable file

    I want to run java console application on windows enivornment...
    how can i do this...


  2. #2
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Location
    Wales, Bangor & England, Warwickshire
    Posts
    820
    My Mood
    Cynical
    Thanks
    7
    Thanked 104 Times in 90 Posts

    Default Re: Jar File to executable file

    Compile you code as an executable jar then you can just run java -jar MyJar
    chris[at]javaprogrammingforums[dot]com

    Prifysgol Bangor University, North Wales

  3. #3
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Jar File to executable file

    how can run this jar file without any command on cmd....
    Actually this is console application ... and i want to run this just single click of mouse like a exe file of c++...

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,437
    Thanks
    49
    Thanked 2,217 Times in 2,190 Posts

    Default Re: Jar File to executable file

    jar files on the Windows OS will be executed by double clicking in the jar file if there is a JRE installed and there is an entry in the registry that associates .jar files with a commandline containing the java command with the -jar option.

    If the application needs a console window, create a batch file that will open the window and start the program in the jar file.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    May 2013
    Posts
    3
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Jar File to executable file

    run-> jar -cvf jarname.jar *.*; *.* is used to include the all file inside the folder like c://..//desktop/test: it means we include the all file inside the test folder.
    And then after we put the main class path inside manifest.ml file.

  6. #6
    Junior Member
    Join Date
    May 2013
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Jar File to executable file

    if you're using eclipse, do this:

    right click your project, export, select as executable jar file, select where you want to save it. done.

Similar Threads

  1. Cannot create executable jar file
    By viper_pranish in forum Java Theory & Questions
    Replies: 4
    Last Post: March 20th, 2013, 10:31 AM
  2. This is a link to full executable jar file.
    By rajeshverma in forum Java Theory & Questions
    Replies: 26
    Last Post: June 30th, 2012, 04:17 AM
  3. [SOLVED] no sound from executable jar file
    By cl2606 in forum What's Wrong With My Code?
    Replies: 17
    Last Post: June 8th, 2011, 06:41 PM
  4. Jar Executable File Not Working
    By Kimimaru in forum Java Theory & Questions
    Replies: 6
    Last Post: October 15th, 2010, 09:32 PM
  5. Jar Executable File
    By The_Mexican in forum What's Wrong With My Code?
    Replies: 43
    Last Post: June 23rd, 2010, 03:53 PM