Window closes too quickly

Reply

Join Date: Aug 2007
Posts: 3
Reputation: NewToJava is an unknown quantity at this point 
Solved Threads: 0
NewToJava NewToJava is offline Offline
Newbie Poster

Window closes too quickly

 
0
  #1
Aug 20th, 2007
hi,
i just wrote my first java program, it compiles and runs and all, but the console window closes too quickly u can hardly see the output.
how can i rectify that?
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 793
Reputation: darkagn has a spectacular aura about darkagn has a spectacular aura about darkagn has a spectacular aura about 
Solved Threads: 110
darkagn's Avatar
darkagn darkagn is offline Offline
Master Poster

Re: Window closes too quickly

 
0
  #2
Aug 20th, 2007
Which OS are you in?
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 3
Reputation: NewToJava is an unknown quantity at this point 
Solved Threads: 0
NewToJava NewToJava is offline Offline
Newbie Poster

Re: Window closes too quickly

 
0
  #3
Aug 20th, 2007
Windows, and i'm using JBuilder
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 793
Reputation: darkagn has a spectacular aura about darkagn has a spectacular aura about darkagn has a spectacular aura about 
Solved Threads: 110
darkagn's Avatar
darkagn darkagn is offline Offline
Master Poster

Re: Window closes too quickly

 
0
  #4
Aug 20th, 2007
Not sure what the problem is, but you could try sending the output to a text file to view it in Notepad. Normally to run a java class file you would type something like
  1. java myProgram
Try
  1. java myProgram > output.txt
That will create a file, output.txt, that you can open and view the console output of your program.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 3
Reputation: NewToJava is an unknown quantity at this point 
Solved Threads: 0
NewToJava NewToJava is offline Offline
Newbie Poster

Re: Window closes too quickly

 
0
  #5
Aug 20th, 2007
Thanks, i'll try the .text u mentioned
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Re: Window closes too quickly

 
0
  #6
Aug 20th, 2007
first better way... is try to run programs in command prompt thats is the best way to start a learning step for java

install jdk 1.5 or latest 1.6

then set your class path

compile it

javac programname.java


and run

java programname

you will get the output in the command prompt console itself
Adios,

Vinod......
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 437
Reputation: Fungus1487 is on a distinguished road 
Solved Threads: 50
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Pro in Training

Re: Window closes too quickly

 
0
  #7
Aug 20th, 2007
use the following at the end of your code

  1. BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
  2. in.readLine();
it will pause your command prompt and wait for an input.
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC