Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2014
    Posts
    28
    Rep Power
    0

    Question Exporting a Java Program from Eclipse that only runs in the Console

    Hi! I have recently revisited a program I wrote a few years ago, that runs absolutely fine in the console in Eclipse. However, when I export it as a Runnable Jar File, then open the file on my Desktop, nothing happens.

    How do I get the program to export so that when I open the file, a window opens that acts as the console (so the program can run in it)?

    Thanks :D

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Exporting a Java Program from Eclipse that only runs in the Console

    Execute the jar from the command line using java -jar.

    when I open the file, a window opens that acts as the console
    That's not how Java works.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Join Date
    Mar 2014
    Posts
    28
    Rep Power
    0

    Default Re: Exporting a Java Program from Eclipse that only runs in the Console

    Can you please show me how to design a window that my game can run in? Also, I don't understand what you meant by: 'command line using java -jar'. Thanks for your help :D

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Exporting a Java Program from Eclipse that only runs in the Console

    Quote Originally Posted by JavaPr0grammer View Post
    Can you please show me how to design a window that my game can run in? Also, I don't understand what you meant by: 'command line using java -jar'. Thanks for your help :D
    Start here: The Java™ Tutorials

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Exporting a Java Program from Eclipse that only runs in the Console

    runs absolutely fine in the console
    Open a command prompt window (also referred to as a console) and enter the command:
    java -jar ThEJARFILENAMEHERE.jar
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 6
    Last Post: 01-30-2014, 01:56 PM
  2. Exporting the Console as .JAR?
    By Stud1 in forum Eclipse
    Replies: 1
    Last Post: 01-14-2014, 03:05 PM
  3. exporting program from eclipse
    By Skaeringur97 in forum New To Java
    Replies: 2
    Last Post: 01-11-2014, 07:35 PM
  4. Eclipse Exporting
    By Delinitor in forum Eclipse
    Replies: 20
    Last Post: 06-19-2012, 09:13 PM
  5. Replies: 0
    Last Post: 10-04-2009, 02:47 PM

Tags for this Thread

Posting Permissions

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