Results 1 to 5 of 5
- 08-13-2012, 05:38 AM #1
Member
- Join Date
- Aug 2012
- Posts
- 2
- Rep Power
- 0
Program running in eclipse but JAR won't run?
This is the code I'm using.
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?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); } }Last edited by JosAH; 08-13-2012 at 11:59 AM. Reason: changed colour to [code] ... [/code] tags
- 08-13-2012, 05:45 AM #2
Student
- Join Date
- Jul 2012
- Location
- United States
- Posts
- 328
- Rep Power
- 1
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
- 08-13-2012, 05:46 AM #3
Member
- Join Date
- Aug 2012
- Posts
- 2
- Rep Power
- 0
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.
- 08-13-2012, 07:27 AM #4
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
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.
- 08-13-2012, 11:52 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
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.
Similar Threads
-
Need help with running programs in eclipse
By HelloWorld1234 in forum New To JavaReplies: 5Last Post: 06-12-2012, 03:49 PM -
problems in running the web app in eclipse
By mkarthik90 in forum EclipseReplies: 2Last Post: 02-28-2012, 06:04 PM -
Running a java program without eclipse / JAR Files?
By littledrummerboy in forum New To JavaReplies: 7Last Post: 05-30-2011, 06:38 PM -
running ANTLR from Eclipse???
By 1wretch in forum EclipseReplies: 3Last Post: 10-24-2009, 02:22 AM -
how to run web server w/out running at eclipse?
By anthrax in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 07-13-2009, 09:06 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks