Results 1 to 5 of 5
  1. #1
    Jma84 is offline Member
    Join Date
    Aug 2012
    Posts
    2
    Rep Power
    0

    Question Program running in eclipse but JAR won't run?

    This is the code I'm using.
    Java Code:
    import java.util.Scanner;
    
    class poop {
    	public static void main(String args[]) {
    		Scanner bucky = new Scanner(System.in);
    		double fnum, snum, answer, anum;
    		System.out.println("Enter first number of passsword:");
    		fnum = bucky.nextDouble();
    		System.out.println("Enter second number of password:");
    		snum = bucky.nextDouble();
    		System.out.print("You are not the Creator. Now deleting all files and logs and executing virus I.D.#2894. Enter Creator I.D. to cancel.");
    		anum = bucky.nextDouble();
    		System.out.println("Wrong I.D. Contact team member 25 for assistance. Below is their I.D. number. Goodbye.");
    		answer = fnum + snum + anum;
    		System.out.println(answer);
    		
    	}
    }
    It runs while I am in eclipse. I exported it as a runnable JAR file, but when I run it, nothing happens. Any fix to my code?
    Last edited by JosAH; 08-13-2012 at 11:59 AM. Reason: changed colour to [code] ... [/code] tags

  2. #2
    awinston is offline Student
    Join Date
    Jul 2012
    Location
    United States
    Posts
    328
    Rep Power
    3

    Default Re: Program running in eclipse but JAR won't run?

    Are you sure nothing happens? Not even an error?
    "Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill

  3. #3
    Jma84 is offline Member
    Join Date
    Aug 2012
    Posts
    2
    Rep Power
    0

    Default Re: Program running in eclipse but JAR won't run?

    Nothing happens at all. My mouse spins like something is, then it stops spinning and nothing happens.

  4. #4
    ics1010 is offline Member
    Join Date
    Aug 2012
    Posts
    10
    Rep Power
    0

    Default Re: Program running in eclipse but JAR won't run?

    It's normally a safe bet that if you run in eclipse and not the jar, how you made the jar is probably the problem and not your code. Run the program from the command line...java.exe -jar jarname.jar.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default Re: Program running in eclipse but JAR won't run?

    If you're not running from the command line, and (as is normal) javaw is the default app for launching a jar file, then I'm not too surprised.
    javaw does not have a console associated with it, and yet you have a console app.

    You'll need to launch this from the command line.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Need help with running programs in eclipse
    By HelloWorld1234 in forum New To Java
    Replies: 5
    Last Post: 06-12-2012, 03:49 PM
  2. problems in running the web app in eclipse
    By mkarthik90 in forum Eclipse
    Replies: 2
    Last Post: 02-28-2012, 06:04 PM
  3. Running a java program without eclipse / JAR Files?
    By littledrummerboy in forum New To Java
    Replies: 7
    Last Post: 05-30-2011, 06:38 PM
  4. running ANTLR from Eclipse???
    By 1wretch in forum Eclipse
    Replies: 3
    Last Post: 10-24-2009, 02:22 AM
  5. how to run web server w/out running at eclipse?
    By anthrax in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 07-13-2009, 09:06 AM

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
  •