| Author |
Main program not giving output
|
Ritika Saxena
Ranch Hand
Joined: Jul 02, 2006
Posts: 51
|
|
Hi, I am running a very basic program using eclipse. When I click on run, the program runs fine but doesnot show any output on the console. Here is my program: package com.test; public class OALTest { public static void main(String[] args) { System.out.println("Testing the OAL Class"); } } I am completely clueless as to what can be the problem in this case???
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
This sounds like an Eclipse-related question, which should be asked in the IDE forum Anyway, are you sure you're executing this class, and not another. Right-click the source, select Run As -> Java Application.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32827
|
|
|
By "console" do you mean a command prompt? You know that Eclipse doesn't use the "java" program, but something called "javaw" which doesn't use the command prompt? I ran your class and got the requisite output on Eclipse.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12950
|
|
|
In Eclipse, make sure the Console view is visible by selecting the menu Window / Show View / Console. Then run your application from Eclipse. The output should appear in the Console view inside Eclipse.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: Main program not giving output
|
|
|